Low-powered blinky example

Dependencies:   mbed

Blinks an LED using a low-power ticker.

Uses the asynchronous APIs and improved sleep API.

Information

All examples in this repo are considered EXPERIMENTAL QUALITY, meaning this code has been created as one-off proof-of-concept and is suitable as a demonstration for experimental purposes only. This code will not be regularly maintained by Silicon Labs and there is no guarantee that these projects will work across all environments, SDK versions and hardware.

Revision:
0:b0927d62ef70
Child:
3:c950338a014e
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Apr 20 14:45:04 2015 +0000
@@ -0,0 +1,15 @@
+#include "mbed.h"
+ 
+DigitalOut myled(LED1);
+LowPowerTicker toggleTicker;
+
+void ledToggler(void) {
+    myled = !myled;
+}
+ 
+int main() {
+    toggleTicker.attach(&ledToggler, 0.2f);
+    while(1) {
+        sleep();
+    }
+}
\ No newline at end of file