PWM + RGB code example for FRDM-KL25Z

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
APanecatl
Date:
Wed Jun 04 19:25:10 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 cb11ef198767 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Jun 04 19:25:10 2014 +0000
@@ -0,0 +1,27 @@
+#include "mbed.h"
+
+PwmOut Red(LED_RED);
+//PwmOut Green(LED_GREEN);
+
+
+
+int main() 
+{
+    Red.period_ms(2000);
+ //   Green.period(1000);
+  //  Red.pulsewidth_ms(500);
+    int x;
+    x=1;
+    
+    while(1)
+    {
+        Red.pulsewidth_ms(x);
+        x=x+2;
+        wait(1);
+        if(x==1000)
+        {
+            x=1;
+        }
+    }
+        
+}
\ No newline at end of file
diff -r 000000000000 -r cb11ef198767 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Jun 04 19:25:10 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/0b3ab51c8877
\ No newline at end of file