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:
124:f67ce69557db
Child:
125:749b8ce2e040
diff -r 6d8f1bdcda05 -r f67ce69557db serialcom.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/serialcom.cpp	Thu Oct 29 18:23:08 2015 +0100
@@ -0,0 +1,22 @@
+#include "mbed.h"
+#include "MODSERIAL.h"
+#include "config.h"
+#include "PID.h"
+#include <string>
+
+MODSERIAL pc(USBTX, USBRX);
+char buf[128];
+
+void serialCom(){
+    pc.scanf("%s", buf);
+    if(strcmp(buf,"ledRed")==0){
+        ledRed.write(!ledRed.read());
+    }
+    if(strcmp(buf,"ledBlue")==0){
+        ledBlue.write(!ledBlue.read());
+    }
+    if(strcmp(buf,"ledGreen")==0){
+        ledGreen.write(!ledGreen.read());
+    }
+}
+