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:
79:cf500b63f349
Parent:
76:0aa90e728e4a
Child:
81:71e7e98deb2c
--- a/actuators.cpp	Tue Oct 20 12:58:13 2015 +0200
+++ b/actuators.cpp	Tue Oct 20 13:21:29 2015 +0200
@@ -48,7 +48,7 @@
 
     // Create object instances
     // Safety Pin
-    InterruptIn safetyInt(safetyPin);
+    DigitalIn safetyIn(safetyPin);
     
     // Initialze motors
     PwmOut motor1(motor1PWMPin);
@@ -71,9 +71,6 @@
     
 void motorInit(){
     
-    // connect safety to interrupt
-    safetyInt.rise(&safety);
-
     motor1Dir.write(direction1);
     motor2Dir.write(direction2);
 
@@ -195,6 +192,8 @@
 
 void safety(){
     if (safetyOn){
-        motorsEnable = false;
+        if (safetyIn.read() != 0){
+            motorsEnable = false;
+        }
     }
-}
\ No newline at end of file
+}