-/*
+/******************************************************************************
 dfrdb
 DFRobot Romeo Drive Bot
 Robot for MakerFaire Kansas City Arch Reactor booth
+drives just the claw - user Sabertooth for motor shield
+
+Pin connections:
+AIL:  (hold pin 0 for this use)
+ELE:  (hold pin 1 for this use)
+THR: 3
+RUD: 2
+power receiver off A5 since digital pins at 7.2V for servos
 
 Read RC signal pulse width by using interrupt then control servos of
-SparkFun robot arm (https://www.sparkfun.com/products/11524 and  https://www.sparkfun.com/products/11674 )
+SparkFun robot arm (https://www.sparkfun.com/products/11524 and 
+https://www.sparkfun.com/products/11674 )
 
 
 DFRobot Romeo v2 controller board 
 http://www.dfrobot.com/wiki/index.php/Romeo_V2-All_in_one_Controller_(R3)_(SKU:DFR0225)
 
-Board has pin config like Leonardo - plan to take advantage of fact that Leonardo has 4 hardware
-interrupts for my 4 controller signals; see http://www.arduino.cc/en/Reference/AttachInterrupt 
+Board has pin config like Leonardo - plan to take advantage of fact that 
+Leonardo has 4 hardware interrupts for my 4 controller signals; 
+see http://www.arduino.cc/en/Reference/AttachInterrupt 
 
                    
 Helpful resources:

  }
} // end loop()

void readWristInterrupt() {
  // interrupt occurs on CHANGE - need to determine if now high (start of pulse) or low (end of pulse
  if(digitalRead(WristInterrupt) == HIGH){
    wristTimer = micros();  // get time stamp for initiation of pulse
  }
  else{   
    // pin must now be low - end of pulse; calculate pulse width
    wristPW = micros() - wristTimer;
    flag = true;
  }
} // end readWristInterrupt()

void readClawInterrupt() {
  // interrupt occurs on CHANGE - need to determine if now high (start of pulse) or low (end of pulse
  if(digitalRead(ClawInterrupt) == HIGH){
    clawTimer = micros();  // get time stamp for initiation of pulse
  }
  else{   
    // pin must now be low - end of pulse; calculate pulse width
    clawPW = micros() - clawTimer;
    flag = true;
  }
} // end readClawInterrupt()

} // end setup()

void loop() {
  // use flag to see if there is actually a new signal
  if (wristFlag){
    noInterrupts(); // pause interrupts so pw signals are read faithfully 
                    // and not changed part way during assignment
    wristPulse = wristPW;
    wristFlag = false;
    interrupts();   // there is a safer way to do this by saving and restoring 
                    // settings register, but since I'm not using extensive 
                    // libraries should be OK
    
    wrist.writeMicroseconds(wristPulse);
  }
  if (clawFlag){ 
    noInterrupts(); 
    clawPulse = clawPW;
    clawFlag = false;
    interrupts(); 
    // for claw want to open/close base on stick, but then hold position; 
    // so increment/decrement depending on position
    // and then keep that value if joystick centered
    if (clawPulse < ClawRDZ){
      clawAngle -= 1; 
    }
    else if (clawPulse > ClawLDZ){
      clawAngle +=1;
    }
    clawAngle = constrain(clawAngle, minClawAngle, maxClawAngle);
