Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
takuya
Date:
Fri Jul 16 17:49:54 2010 +0000
Commit message:

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
--- /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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Jul 16 17:49:54 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9114680c05da