  * at fist, index reading 766, middle reading 759, ring reading 796
  * choose middle value 650 to compare and determine if finers are relaxed or curled up
  * 
- * data acquisition rate: 781Hz loop speed without any computation, most time spent in writing 
+ * data acquisition rate: 755Hz loop speed without any computation, most time spent in writing 
  * to accelerometer. 
  */
 

int16_t accel_X_reading = 0; //lpf of AcX
bool indexRelax, middleRelax, ringRelax;
enum state {idle,forward_drive, backup, left_turn,right_turn};
uint8_t turning_speed; //in forward drive and backup mode, turning_speed is set to 0
                       //in turning state, turning speed is a function of accel reading

void ISR_interrupt(){
  /*upon an interrupt, send catapult throw command*/
  /*right now, we can turn on LED to indicate this event*/
  digitalWrite(13,HIGH);
}
void setup(){
  state gestureState = idle;
  Wire.begin();
  mpu.initialize();
  mpu.dmpInitialize();

  AcX=Wire.read()<<8|Wire.read();  // 0x3B (ACCEL_XOUT_H) & 0x3C (ACCEL_XOUT_L)     
  AcY=Wire.read()<<8|Wire.read();  // 0x3D (ACCEL_YOUT_H) & 0x3E (ACCEL_YOUT_L)
  AcZ=Wire.read()<<8|Wire.read();  // 0x3F (ACCEL_ZOUT_H) & 0x40 (ACCEL_ZOUT_L)
  accel_X_reading = 0.99 * accel_X_reading + 0.01 * AcX; //LPF here, check if this works since float is involved
  //Serial.print("accel_X_reading is ");Serial.println(accel_X_reading);
  //Serial.print("number of interrupts is ");Serial.println(x);
  int indexFingerReading = analogRead(A0);
  indexRelax = relax(indexFingerReading);
  int middleFingerReading = analogRead(A1);
