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:
14:cdc203a0bdc1
Parent:
13:292326e5d3bb
--- a/main.cpp	Tue Sep 09 12:44:18 2014 +0000
+++ b/main.cpp	Tue Sep 09 17:29:17 2014 +0000
@@ -14,6 +14,13 @@
     __WFI();
 }
 
+void myPowerDown() {
+    LPC_PMU->PCON = 0x2;
+    SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
+    LPC_SYSCON->PDAWAKECFG &= 0xFFFFF800;
+    __WFI();
+}
+
 void sweepMode(float delayTime)
 {
         for(int x=0; x<7; x++)
@@ -159,13 +166,13 @@
         int x = (int) RNG.getByte() % 7;
         switch(x) {
             case 0:
-                binaryMode(0.05);
+                binaryMode(0.025);
                 break;
             case 1:               
-                randomMode(0.05);
+                randomMode(0.025);
                 break;
             case 2:
-                grayMode(0.05);
+                grayMode(0.025);
                 break;                
             case 3:
                 bounceMode(0.05);
@@ -174,14 +181,14 @@
                 pileMode(0.05);
                 break;
             case 5:
-                multiSweepMode(0.05);
+                multiSweepMode(0.025);
                 break;
             case 6:
                 sweepMode(0.05);
                 break;
         }
         bumpMode(0.05);
-        WakeUp::set(10);
-        myDeepSleep();
+        WakeUp::set(30);
+        myPowerDown();
     }
 }