 int lastRawOffset = 0;
 const int flipThresh = 700;  // threshold to determine whether or not a flip over the 180 degree mark occurred
 boolean flipped = false;
+
 
 // Kinematics
 double xh = 0;         // position of the handle [m]

double Tp = 0;              // torque of the motor pulley
double duty = 0;            // duty cylce (between 0 and 255)
unsigned int output = 0;    // output command to the motor


/*

  // Set up serial communication
  Serial.begin(57600);

  // Set PWM frequency
  setPwmFrequency(pwmPin, 1);
  // Input pins
  pinMode(sensorPosPin, INPUT); // set MR sensor pin to be an
  // set joystick pins as input with pullup 
  pinMode(joyFwdPin, INPUT_PULLUP);
  pinMode(joyBackPin, INPUT_PULLUP);
  pinMode(joyLeftPin, INPUT_PULLUP);
