A blinky variation for the mBuino with a bunch of different blink modes, deep-sleeping between iterations.

Dependencies:   Crypto RNG mbed WakeUp

Fork of mBuinoBlinky by Aron Phillips

mBuino blinky experiments.

Revision:
6:fe79549495e0
Parent:
5:48b81f5fd186
Child:
7:c9e707fc8aa3
--- a/main.cpp	Fri Sep 05 02:17:25 2014 +0000
+++ b/main.cpp	Fri Sep 05 02:46:07 2014 +0000
@@ -21,13 +21,31 @@
         }
 }
 
+void bounceMode(float delayTime)
+{
+        for(int x=0; x<7; x++)
+        {
+            LED[x] = 1;
+            wait(delayTime);
+            LED[x] = 0;
+        }
+
+        for(int x=6; x>=0; x--)
+        {
+            LED[x] = 1;
+            wait(delayTime);
+            LED[x] = 0;
+        }
+}
+
 void randomMode(float delayTime)
 {
     for(int x=0; x<128; x++) {
         rndLED = (int) RNG.getByte() % 8;
         LED[rndLED]=1;
+        wait(0.01);
+        LED[rndLED]=0;
         wait(delayTime);
-        LED[rndLED]=0;
     }
 }
 
@@ -70,5 +88,8 @@
         randomMode(0.025);
         sweep(0.05);
         grayMode(0.05);
+        sweep(0.05);
+        bounceMode(0.1);
+        bounceMode(0.1);
     }
 }