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 4180_Lab2_Motor by
Revision 1:9055ef18d2dd, committed 2016-09-25
- Comitter:
- jeremycai3721
- Date:
- Sun Sep 25 19:02:27 2016 +0000
- Parent:
- 0:7bbc230e00d6
- Commit message:
- CodeShare;
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Nov 23 16:19:19 2010 +0000
+++ b/main.cpp Sun Sep 25 19:02:27 2016 +0000
@@ -3,11 +3,15 @@
#include "mbed.h"
#include "Motor.h"
+AnalogIn ain(p15);
+
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);
+
+
+ while (1) {
+ m.speed(ain);
+ wait(0.1);
}
}
