My Pwm program with method number 1

Dependencies:   mbed

Revision:
0:102eab0a783a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun Feb 15 19:32:08 2015 +0000
@@ -0,0 +1,23 @@
+#include "mbed.h"
+
+PwmOut mypwm(LED1);
+
+//DigitalOut myled(LED1);
+
+int main() {
+    
+    mypwm.period_ms(10);
+    mypwm.pulsewidth_ms(1);
+  
+    printf("pwm set to %.2f %%\n", mypwm.read() * 100);
+    
+    while(1) {
+        for(uint8_t i=0;i<10;i++)
+        {
+            mypwm.pulsewidth_ms(i);
+            wait(0.03);   
+        }
+  //      myled = !myled;
+      //  wait(1);
+    }
+}