Dependencies:   mbed

Fork of PwmOut_HelloWorld by mbed_example

Files at this revision

API Documentation at this revision

Comitter:
MechB021
Date:
Fri Oct 07 03:55:02 2016 +0000
Parent:
1:5160ea45399b
Commit message:

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	Sun Sep 21 06:39:30 2014 +0000
+++ b/main.cpp	Fri Oct 07 03:55:02 2016 +0000
@@ -1,12 +1,15 @@
 #include "mbed.h"
 
-PwmOut led(LED1);
+PwmOut led(D5);
+//DigitalOut led(led);
 
 int main() {
     // specify period first
-    led.period(4.0f);      // 4 second period
-    led.write(0.50f);      // 50% duty cycle, relative to period
+    led.period(0.01f);      // 4 second period
+    led.write(0.150f);      // 50% duty cycle, relative to period
     //led = 0.5f;          // shorthand for led.write()
     //led.pulsewidth(2);   // alternative to led.write, set duty cycle time in seconds
-    while(1);
+    while(1){
+        printf("%f\n",led.read());
+    }
 }
\ No newline at end of file
--- a/mbed.bld	Sun Sep 21 06:39:30 2014 +0000
+++ b/mbed.bld	Fri Oct 07 03:55:02 2016 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/552587b429a1
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/25aea2a3f4e3
\ No newline at end of file