Werkend motorscript met led feedback

Dependencies:   Encoder MODSERIAL mbed

Fork of frdm_Motortryout2 by Robert Schulte

Revision:
1:4e65a72b622e
Parent:
0:c8684fed9b61
Child:
2:2b8a8be38c85
--- a/main.cpp	Mon Sep 21 10:11:51 2015 +0000
+++ b/main.cpp	Mon Sep 21 10:16:05 2015 +0000
@@ -12,17 +12,20 @@
 {
     motor2direction = 0;
     motor2speed = 0;
+    led = 1;
     pc.baud(9600);
     while(true)
     {
-            if(button1 == 1)
+            if(button1 == 0)
                 {
                     motor2direction = 1;
                     motor2speed = 0.5f;
                     pc.printf("het werkt");
-                    wait(1)
+                    wait(1);
                     led = 0;
-                    wait(0.2f)
+                    wait(0.2f);
+                    motor2speed = 0;
+                    led = 1;
                 }
     }   
 }
\ No newline at end of file