g

Dependencies:   MODSERIAL mbed Encoder

Revision:
0:e9e50c0a6502
Child:
1:8a0a39740897
diff -r 000000000000 -r e9e50c0a6502 begintotaalscript.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/begintotaalscript.cpp	Thu Oct 31 14:10:59 2013 +0000
@@ -0,0 +1,57 @@
+#include "mbed.h"
+#include "MODSERIAL.h"
+
+
+int main()
+{
+
+    MODSERIAL pc(USBTX,USBRX,64,1024);
+    pc.baud(115200);
+
+
+    DigitalIn knop1(PTC2);
+    DigitalIn knop2(PTB3);
+    DigitalIn knop3(PTB2);
+
+    knop1.mode(PullUp);
+    knop2.mode(PullUp);
+    knop3.mode(PullUp);
+
+    int state = 1;
+
+    while (true) {
+
+        if (state == 1)
+            pc.printf("state 1 rust| 1=cal motor 2=cal emg 3=tekenen /n/r");
+
+        if (knop1 == false ) {
+            state=2;
+            wait(0.05);
+        }
+
+        if (knop2 == false ) {
+            state=3;
+            wait(0.05);
+        }
+        if (knop3 == false ) {
+            state=6;
+            wait(0.05);
+        }
+        
+
+
+
+        if (state == 2)
+            pc.printf("state 2 cal robot| 2= rust /n/r");
+        if (state == 3)
+            pc.printf("state 3 cal EMG | 1=cal emg laag 3=cal emg hoog /n/r");
+        //if (state == 4)
+          //  pc.printf("state 1 | 1=cal motor 2=cal emg 3=tekenen /n/r");
+        //if (state == 5)
+          //  pc.printf("state 1 | 1=cal motor 2=cal emg 3=tekenen /n/r");
+        if (state == 6)
+            pc.printf("state 6 tekenen| 6=rust /n/r");
+
+    } //sluiten oneindige while loop
+
+}//afsluiten main
\ No newline at end of file