4180Lab1Part1&2

Dependencies:   mbed

Revision:
1:dcefd568845d
Parent:
0:3c5cdcee59dd
Child:
2:51a94a489f09
--- a/main.cpp	Tue Jan 24 23:35:58 2017 +0000
+++ b/main.cpp	Tue Jan 24 23:51:32 2017 +0000
@@ -14,7 +14,7 @@
     pwmdown.mode(PullUp);
     
     // Part 2
-    myled3.period(0.1f);
+    myled3.period(1.0f);
     volatile float duty = 0.50f;
     myled3.write(duty);
     while(1) {
@@ -28,13 +28,13 @@
         
         // Part 2
         if(pwmup == 0 && duty < 1.00f) {
-            duty = duty + 0.01f;
+            duty = duty + 0.001f;
             //duty += 0.10f;
             //duty = 1.0f;
             myled3.write(duty);
         }
         if(pwmdown == 0 && duty > 0.00f) {
-            duty = duty - 0.01f;
+            duty = duty - 0.001f;
             //duty -= 0.10f;
             //duty = 0.0f;
             myled3.write(duty);