control DC motor using pwm
Dependencies: Motordriver mbed
Fork of Motor_HelloWorld by
Diff: main.cpp
- Revision:
- 1:a96dd8db5c11
- Parent:
- 0:7bbc230e00d6
diff -r 7bbc230e00d6 -r a96dd8db5c11 main.cpp --- a/main.cpp Tue Nov 23 16:19:19 2010 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -// Sweep the motor speed from full-speed reverse (-1.0) to full speed forwards (1.0) - -#include "mbed.h" -#include "Motor.h" - -Motor m(p23, p6, p5); // pwm, fwd, rev - -int main() { - for (float s= -1.0; s < 1.0 ; s += 0.01) { - m.speed(s); - wait(0.02); - } -}