Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
jderemer3
Date:
Wed Mar 01 16:38:41 2017 +0000
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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Mar 01 16:38:41 2017 +0000
@@ -0,0 +1,20 @@
+#include "mbed.h"
+ 
+PwmOut driv(p21);
+ 
+int main() {
+    // specify period first
+    driv.period(0.0125f);     // 4 second period
+    //driv.write(0.5f);      // 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)
+    {
+        for (int i = 0; i < 10; i++)
+        {
+            float inc = i*0.1f;
+            driv.write(inc);
+            wait(1);
+        }
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Mar 01 16:38:41 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/176b8275d35d
\ No newline at end of file