FRDM-K64 PWM basic demo

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
APanecatl
Date:
Wed Jul 09 19:31:42 2014 +0000
Commit message:
rev 1.0

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
diff -r 000000000000 -r 24a5f9b6fd64 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Jul 09 19:31:42 2014 +0000
@@ -0,0 +1,22 @@
+#include "mbed.h"
+
+//PWM output channel
+PwmOut PWM1(A5);
+
+int main() 
+{
+    PWM1.period_ms(500);
+    int x;
+    x=1;
+    
+    while(1)
+    {
+        PWM1.pulsewidth_ms(x);
+        x=x+1;
+        wait(.1);
+        if(x==500)
+        {
+            x=1;
+        }
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r 24a5f9b6fd64 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Jul 09 19:31:42 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/024bf7f99721
\ No newline at end of file