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:
- 128:c583aff5a7bf
- Parent:
- 127:831f03471efb
--- a/main.cpp Thu Oct 29 22:46:30 2015 +0100 +++ b/main.cpp Thu Oct 29 23:43:54 2015 +0100 @@ -43,7 +43,9 @@ bool usePotmeters = true; // flag for using the potmeters/EMG to control the system bool controlAngle = false; // control the system using motor angles bool controlDirection = true; // control the system using kinematics - +bool enableEMG = false; +bool startCalibration = false; +bool EMGCalReady = false; int main(){ serialInit(); @@ -60,10 +62,13 @@ calReady = calibrateMotors(); } if(emg_go){ + emg_go=false; if(enableEMG){ - emg_go=false; readEMG(); } + if(mode==0){ + EMGCalReady = true; + } } if(calReady && !tickersActivated){ // when done with calibration, start rest of tickers tickerAttach(); @@ -85,9 +90,5 @@ motor_go=false; motorControl(); // write data to the motors } - - if(mode==0){ - - } } } \ No newline at end of file