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:
86:a5f48ae7096e
Parent:
81:71e7e98deb2c
Child:
88:dd198c58f053
diff -r 03dc24043236 -r a5f48ae7096e main.cpp
--- a/main.cpp	Tue Oct 20 15:28:11 2015 +0200
+++ b/main.cpp	Tue Oct 20 15:43:54 2015 +0200
@@ -14,6 +14,7 @@
 #include "debug.h"
 #include "emg.h"
 
+bool start=false;
 Ticker switchesTick, debugTick, motorTick, EMGTick, safetyTick;
 volatile bool switches_go=false, debug_go=false, motor_go=false, emg_go=false, safety_go=false;
 
@@ -25,8 +26,13 @@
 
 double motorCall = 0.01; // set motor frequency global so it can be used for speed.
 int main(){
+DigitalIn startButton(startPin);
+    if(startButton.read()==0){
+        start=true;
+    }
+
+if(start){
 motorInit();    
-calibrateMotors(); // start calibration procedure
 
 switchesTick.attach(&switches_activate, 0.02f);
 debugTick.attach(&debug_activate, 0.03f);
@@ -58,4 +64,5 @@
         // servoControl();
         }
     }
+}
 }
\ No newline at end of file