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:
42:d36d216457c4
Parent:
41:d5c3055a7bc7
Child:
44:a947bc232d84
--- a/buttons.cpp	Thu Oct 08 13:03:22 2015 +0200
+++ b/buttons.cpp	Thu Oct 08 13:58:54 2015 +0200
@@ -17,8 +17,8 @@
 
 DigitalIn button1(button1Pin);
 DigitalIn button2(button2Pin);
-float button1Pressed = false;
-float button2Pressed = false;
+bool button1Pressed = false;
+bool button2Pressed = false;
 int actuatorState = 0;
 
 float pot1Val = 0;
@@ -39,7 +39,7 @@
 	}else{
 		button1Pressed = false;
 	}
-	if(button2.read() == 0){
+	if(button2.read() != 1){
 		if(button2Pressed != true){
 			actuatorState++;
 			if(actuatorState==3){