Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 13:deb1e793f125
- Parent:
- 11:043a63c952a0
- Child:
- 15:b6025338e0eb
--- 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
