ECE 4180 Lab 2 Part 10

Dependencies:   Motor mbed

Fork of Motor_HelloWorld by Simon Ford

Files at this revision

API Documentation at this revision

Comitter:
abraha2d
Date:
Tue Oct 09 00:50:42 2018 +0000
Parent:
0:7bbc230e00d6
Commit message:
Save point

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld 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	Tue Oct 09 00:50:42 2018 +0000
@@ -5,9 +5,16 @@
 
 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);
+int main()
+{
+    while (1) {
+        for (float s= -1.0; s < 1.0 ; s += 0.01) {
+            m.speed(s);
+            wait(0.02);
+        }
+        for (float s= 1.0; s > -1.0 ; s -= 0.01) {
+            m.speed(s);
+            wait(0.02);
+        }
     }
 }
--- a/mbed.bld	Tue Nov 23 16:19:19 2010 +0000
+++ b/mbed.bld	Tue Oct 09 00:50:42 2018 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/e2ac27c8e93e
+https://os.mbed.com/users/mbed_official/code/mbed/builds/e95d10626187
\ No newline at end of file