RGB LED chika chika

Dependencies:   mbed

Fork of mbed_LED_chika by shinichi satoh

Revision:
8:c87c95d37988
Parent:
4:81cea7a352b0
Child:
9:5ba1eff3500b
--- a/main.cpp	Thu Mar 26 22:33:50 2015 +0000
+++ b/main.cpp	Wed Jul 15 11:23:20 2015 +0000
@@ -1,12 +1,22 @@
 #include "mbed.h"
 
-DigitalOut myled(LED1);
+DigitalOut myled1(LED1);
+DigitalOut myled2(LED2);
+DigitalOut myled3(LED3);
+DigitalIn  mysw1(PTA4);
+DigitalIn  mysw2(PTC6);
 
 int main() {
+    int i=0;
     while(1) {
-        myled = 1;
-        wait(0.2);
-        myled = 0;
-        wait(0.2);
+        myled1 = mysw1;
+        myled2 = mysw2;
+        myled3 = 1;
+        wait(0.9);
+        myled1 = 0;//(i>>2)&1;
+        myled2 = 0;//(i>>1)&1;
+        myled3 = 0;//(i)&1;
+        wait(0.1);
+        i++;
     }
 }