takuya . / Mbed 2 deprecated ledpwm0

Dependencies:   mbed

Revision:
0:38eeebe6f17e
diff -r 000000000000 -r 38eeebe6f17e main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Jul 16 17:49:54 2010 +0000
@@ -0,0 +1,55 @@
+#include "mbed.h"
+
+PwmOut led1(LED1);
+PwmOut led2(LED2);
+PwmOut led3(LED3);
+PwmOut led4(LED4);
+
+int main() {
+    while (1) {
+        for (float p = 0.01f; p < 0.999f; p += 0.01f) {
+            led1 = p;
+            wait(0.01);
+        }
+        for (float p = 0.999f; p > 0.01f; p -= 0.01f) {
+            led1 = p;
+            wait(0.01);
+        }
+        
+        wait(2);
+        
+        for (float p = 0.01f; p < 0.999f; p += 0.01f) {
+            led2 = p;
+            wait(0.01);
+        }
+        for (float p = 0.999f; p > 0.01f; p -= 0.01f) {
+            led2 = p;
+            wait(0.01);
+        }
+        
+        wait(2);
+        
+        for (float p = 0.01f; p < 0.999f; p += 0.01f) {
+            led3 = p;
+            wait(0.01);
+        }
+        for (float p = 0.999f; p > 0.01f; p -= 0.01f) {
+            led3 = p;
+            wait(0.01);
+        }
+        
+        wait(2);
+        
+        for (float p = 0.01f; p < 0.999f; p += 0.01f) {
+            led4 = p;
+            wait(0.01);
+        }
+        for (float p = 0.999f; p > 0.01f; p -= 0.01f) {
+            led4 = p;
+            wait(0.01);
+        }
+        
+        wait(2);
+        
+    }
+}
\ No newline at end of file