Lab2 Part 6

Dependencies:   mbed

Fork of 4180Lab2_part6 by ECE4180

Files at this revision

API Documentation at this revision

Comitter:
ldeng31
Date:
Tue Oct 06 19:36:39 2015 +0000
Parent:
2:7481c04acf7f
Commit message:
Lab2_part6;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Sat Sep 05 19:40:05 2015 +0000
+++ b/main.cpp	Tue Oct 06 19:36:39 2015 +0000
@@ -1,12 +1,15 @@
 #include "mbed.h"
 
-PwmOut control(p26);
+DigitalOut control(p26);
 
 int main() {
     while(1) {
-        for(float p = 0.0f; p < 1.0f; p += 0.1f) {
+        //for(float p = 0.0f; p < 1.0f; p += 0.1f) {
+            float p = 1.0f;
             control.write(p);
-            wait(5.0);
+            wait(1.0);
+            float q = 0.0f;
+            control.write(q);
+            wait(1.0);
         }
     }
-}
\ No newline at end of file