IOP / Mbed 2 deprecated PWM_LEDControl_HelloWorld_WIZwiki-W7500

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
jcm931213
Date:
Thu Apr 20 02:17:28 2017 +0000
Parent:
0:7ee88984a52b
Child:
2:8b2466c9dce3
Commit message:
create led control example

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Wed Apr 19 09:31:05 2017 +0000
+++ b/main.cpp	Thu Apr 20 02:17:28 2017 +0000
@@ -10,10 +10,10 @@
     int i;
     
     while(1){
-        for(i=100; i>0; i=i-1) {
-           pwm0.write(i*0.01);
-           pwm1.pulsewidth_ms(i*0.01);
-           wait(0.5);
+        for(i=1000; i>0; i=i-1) {
+           pwm0.write(i*0.001);
+           pwm1.pulsewidth_us(i*100);
+           wait(0.005);
         }
     }
 }