PWM + RGB code example for FRDM-KL25Z

Dependencies:   mbed

Revision:
0:cb11ef198767
--- /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