David Pasztor / Mbed 2 deprecated Motor_control

Dependencies:   mbed-rtos mbed

Revision:
13:deb1e793f125
Parent:
11:043a63c952a0
Child:
15:b6025338e0eb
diff -r 043a63c952a0 -r deb1e793f125 main.cpp
--- a/main.cpp	Tue Mar 14 21:50:17 2017 +0000
+++ b/main.cpp	Tue Mar 14 21:58:29 2017 +0000
@@ -85,7 +85,7 @@
     
     dt_I3.start();          //Start the time counters for velocity
         
-    //controlTicker.attach(&control, dt);
+    controlTicker.attach(&control, dt);
     
     I1.rise(&i_edge);       //Assign interrupt handlers for LEDs
     I1.fall(&i_edge);
@@ -103,10 +103,8 @@
     motorOut((state-orState+lead+6)%6, 0.5f);            //Kickstart the motor
     wait(60);
     
-    while (1/*count_i3<=goalRevs*/) {
+    while (count_i3<=goalRevs) {
         pc.printf("Speed: %f, duty cycle: %f, revs done: %d \n\r",w3, duty, count_i3);
-        stopMotor();
-        return 0;
         /*
         if(duty < 0.00f) {
             stopMotor();
@@ -120,4 +118,6 @@
         }
         */
     }
+    stopMotor();
+    return 0;
 }
\ No newline at end of file