encoder verwerkt

Dependencies:   MODSERIAL QEI mbed

Fork of motor_control by Floor Couwenberg

Revision:
1:e415c6eda278
Parent:
0:8ed7e7bbc391
Child:
2:80753272d9e4
--- a/main.cpp	Mon Sep 26 13:40:12 2016 +0000
+++ b/main.cpp	Thu Sep 29 13:29:18 2016 +0000
@@ -1,30 +1,20 @@
 #include "mbed.h"
 
-DigitalIn switch2(SW2);
-DititalIn switch3(SW3);
-DigitalOut  groen(LED_GREEN);
-DigitalOut  rood(LED_RED);
+DigitalOut motor(D4);
+PwmOut pwm_motor(D5);
+//DigitalIn switch3(SW3);
+
 Serial pc(USBTX, USBRX);
 
-int main()
+int CW = 0;
+int CCW = 1;
+
+int main ()
 {
-    groen = 1;
-    rood = 1;
-    
     while (true){
-    
-        if (SW2 == 0){
-            groen = 0;
-            rood = 1;
-            }
-        else if (SW3 == 0){
-            groen = 1;
-            rood = 0;
-            }
-        else{
-            groen = 1;
-            rood = 1;
-        }
-    }
-}    
-        
\ No newline at end of file
+        motor = CW;
+        pwm_motor = 0.5;
+        
+        
+}
+}
\ No newline at end of file