   Serial.print("I'll use the high value: "); Serial.println(high_val);
   Serial.print("and the low value: ");       Serial.println(low_val);
 }
+
+void setupPID(){
+  //initialize the variables we're linked to
+  Setpoint = 0;
+
+  //tell the PID to range between 0 and the full window size
+  pid.SetOutputLimits(0, 1);
+
+  //turn the PID on
+  pid.SetMode(AUTOMATIC);  
+}

 * e.g. [-100, 100]
 */
double pollProximity(){
  return map(vcnl.readProximity(), HIGH_PROX_VAL, LOW_PROX_VAL, -FIDELITY, FIDELITY);
}

/*

 */
#include <Wire.h>
#include "Adafruit_VCNL4010.h"
#include <PID_v1.h>

Adafruit_VCNL4010 vcnl;

//Define Variables we'll be connecting to
double Setpoint, Input, Output;

//Specify the links and initial tuning parameters
double Kp = 32609.0;
double Ki = 34517.0;
double Kd = 7086;

PID pid(&Input, &Output, &Setpoint, Kp,Ki,Kd, DIRECT);

static double FIDELITY = 157.35;

static int FET_ONE = 3; // The black magnet
static int FET_TWO = 5; // The yellow magnet

double HIGH_PROX_VAL = 0.0;
double LOW_PROX_VAL  = 0.0;

int WindowSize = 5000;
unsigned long windowStartTime;

void setupProximitySensor(double &high_val, double &low_val); 
void setupPID();
double pollProximity();
void pwm(int pin, double high, double low);

