![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
control for robotic arm that can play chess using a granular gripper
Dependencies: Encoder mbed HIDScope Servo MODSERIAL
Fork of chessRobot by
Diff: main.cpp
- Revision:
- 95:94f02d01ebdf
- Parent:
- 92:12e2e57e900a
diff -r 28e274481b60 -r 94f02d01ebdf main.cpp --- a/main.cpp Wed Oct 21 12:03:43 2015 +0000 +++ b/main.cpp Wed Oct 21 12:09:45 2015 +0000 @@ -23,26 +23,11 @@ Ticker switchesTick, debugTick, motorTick, EMGTick, safetyTick; volatile bool switches_go=false, debug_go=false, motor_go=false, emg_go=false, safety_go=false; -void switches_activate() -{ - switches_go=true; -}; -void debug_activate() -{ - debug_go=true; -}; -void motor_activate() -{ - motor_go=true; -}; -void emg_activate() -{ - emg_go=true; -}; -void safety_activate() -{ - safety_go=true; -}; +void switches_activate(){switches_go=true;}; +void debug_activate(){debug_go=true;}; +void motor_activate(){motor_go=true;}; +void emg_activate(){emg_go=true;}; +void safety_activate(){safety_go=true;}; double motorCall = 0.005; // set motor frequency global so it can be used for speed. int main() @@ -55,7 +40,8 @@ } while (start == true) { motorInit(); - + calibrateMotors(); // start calibration procedure + EMGTick.attach(&emg_activate, 0.005f); switchesTick.attach(&switches_activate, 0.02f); debugTick.attach(&debug_activate, 0.03f); @@ -68,9 +54,6 @@ readEMG(); } } - - calibrateMotors(); // start calibration procedure - while (true) { if(safety_go) { safety_go=false;