![](/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:
- 59:fe00be2cf8fd
- Parent:
- 57:43f707648f2b
- Child:
- 60:20945383ad1b
--- a/main.cpp Mon Oct 12 11:52:47 2015 +0200 +++ b/main.cpp Mon Oct 12 12:16:58 2015 +0200 @@ -1,16 +1,27 @@ +/* + ________ ____ __ __ + / ____/ /_ ___ __________ / __ \____ / /_ ____ / /_ + / / / __ \/ _ \/ ___/ ___/ / /_/ / __ \/ __ \/ __ \/ __/ +/ /___/ / / / __(__ |__ ) / _, _/ /_/ / /_/ / /_/ / /_ +\____/_/ /_/\___/____/____/ /_/ |_|\____/_.___/\____/\__/ + +*/ + #include "mbed.h" #include "config.h" // settings and pin configurations #include "actuators.h" #include "buttons.h" #include "debug.h" +#include "EMG.h" -int a = 3; -Ticker switches, debug, motor; -volatile bool switches_go=false, debug_go=false, motor_go=false; +Ticker switches, debug, motor, EMG; +volatile bool switches_go=false, debug_go=false, motor_go=false, EMG_activate= false; void switches_activate(){switches_go=true;}; void debug_activate(){debug_go=true;}; void motor_activate(){motor_go=true;}; +void motor_activate(){emg_go=true;}; + float motorCall = 0.001; // set motor frequency global so it can be used for speed. @@ -21,9 +32,14 @@ switches.attach(&switches_activate, 0.02f); debug.attach(&debug_activate, 0.03f); motor.attach(&motor_activate, motorCall); +EMG.attach(&EMG_activate, motorCall); + while (true) { - // readEMG(); + // if(emg_go){ + // emg_go=false; + // readEMG(); + // } // servoControl(); if(switches_go){ switches_go=false;