control for robotic arm that can play chess using a granular gripper

Dependencies:   Encoder mbed HIDScope Servo MODSERIAL

Fork of chessRobot by a steenbeek

Revision:
129:53d23eae7a6a
Parent:
128:c583aff5a7bf
Child:
130:2542f844ba1e
--- a/serialcom.cpp	Thu Oct 29 23:43:54 2015 +0100
+++ b/serialcom.cpp	Fri Oct 30 01:03:02 2015 +0100
@@ -8,6 +8,10 @@
 
 Serial pc(USBTX, USBRX);
 char buf[128];
+int transmitDOF;
+bool EMGCalReady = false;
+bool enableEMG = false;
+bool startCalibration = false;
 
 void serialInit(){
     const int baudrate = 9600;
@@ -38,15 +42,19 @@
     }
     if(strcmp(buf, "enableEMG")==0){
         enableEMG = true;
+        usePotmeters = false;
     }
     if(strcmp(buf, "usePotmeters")==0){
         usePotmeters = true;
+        enableEMG = false;
     }
     if(strcmp(buf, "controlAngle")==0){
         controlAngle = true;
+        controlDirection = false;
     }
     if(strcmp(buf, "controlDirection")==0){
         controlDirection = true;
+        controlAngle = false;
     }
 
     // Writers
@@ -65,14 +73,11 @@
     pc.printf("motor2Pos %.3ld\n", motor2Pos);
 
     // transmit correct DOF controller
-    if(usePotermers){
+    if(usePotmeters){
         transmitDOF = actuatorState; // DOF controlled by buttons
     }if(enableEMG){
         transmitDOF = DOF; // DOF controlled by EMG
     }
     pc.printf("DOF %i\n", transmitDOF);  // DOF: 1=x 2=y 3=z
-
-
-
 }