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:
101:b821e89fc108
Parent:
99:7030e9790b1d
Child:
102:b3ab436fbe8e
diff -r 222c27f55b85 -r b821e89fc108 buttons.cpp
--- a/buttons.cpp	Thu Oct 22 08:51:50 2015 +0000
+++ b/buttons.cpp	Thu Oct 22 09:34:31 2015 +0000
@@ -4,6 +4,8 @@
 #include "actuators.h"
 #include "PID.h"
 
+//#define TUNEPID // enable tuning PID parameters with potmeters
+//#define SETPOS // enable position tuning with potmeters
 // functions for reading all the buttons and switches 
 AnalogIn pot2(pot2Pin);
 AnalogIn pot1(pot1Pin);
@@ -47,10 +49,17 @@
 		button1Pressed = false;
 	}
 
-	#ifdef TUNEPID
-		setForPID(); // if TUNEPID is defined, use potmeters for PID tuning
-	#else
+//	#ifdef TUNEPID
+//		setForPID(); // if TUNEPID is defined, use potmeters for PID tuning
+//	#endif
+	#ifdef SETPOS
 		setForPositions(); // else use it for motor control
+	#else // still show that motors are enabled using RGB led
+		if(motorsEnable){
+			redLed.write(0); greenLed.write(0); blueLed.write(1);
+		}else{
+			redLed.write(1); greenLed.write(1); blueLed.write(1);
+		}
 	#endif
 }