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
mBuino blinky experiments.
Revision 10:8a901b6d8cfa, committed 2014-09-08
- Comitter:
- mikewebkist
- Date:
- Mon Sep 08 01:20:52 2014 +0000
- Parent:
- 9:7ae675372031
- Child:
- 11:be76674d2dbd
- Commit message:
- Deep Sleep after one iteration: http://mbed.org/forum/repo-52552-mBuino_low_power_led_flasher-community/topic/5130/
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Sat Sep 06 02:44:07 2014 +0000 +++ b/main.cpp Mon Sep 08 01:20:52 2014 +0000 @@ -6,6 +6,13 @@ int rndLED = 0; Random RNG = Random(); +void myDeepSleep() { + LPC_PMU->PCON = 0x1; + SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk; + LPC_SYSCON->PDAWAKECFG &= 0xFFFFF800; + __WFI(); +} + void sweep(float delayTime) { for(int x=0; x<7; x++) @@ -138,5 +145,6 @@ pileMode(0.05); sweep(0.05); multiSweepMode(0.05); + myDeepSleep(); } }