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.
Fork of Motor_HelloWorld by
Revision 1:dfd892e1309d, committed 2017-02-27
- Comitter:
- CRaslawski
- Date:
- Mon Feb 27 22:41:15 2017 +0000
- Parent:
- 0:7bbc230e00d6
- Commit message:
- initial commit
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 7bbc230e00d6 -r dfd892e1309d main.cpp --- a/main.cpp Tue Nov 23 16:19:19 2010 +0000 +++ b/main.cpp Mon Feb 27 22:41:15 2017 +0000 @@ -3,11 +3,15 @@ #include "mbed.h" #include "Motor.h" -Motor m(p23, p6, p5); // pwm, fwd, rev +Motor m(p21, p6, p5); // pwm, fwd, rev +AnalogIn pot(p20); // cookin int main() { - for (float s= -1.0; s < 1.0 ; s += 0.01) { - m.speed(s); - wait(0.02); + + float r = pot.read(); + + while(1){ + m.speed(pot); + wait(0.02); } }