KL46Z example for NMHU AAA clas

Dependencies:   SLCD mbed

Fork of blink_kl46z by Stanley Cohen

Files at this revision

API Documentation at this revision

Comitter:
scohennm
Date:
Thu Aug 14 21:18:38 2014 +0000
Child:
1:d7c915e8a270
Commit message:
Shows a little more logic and defines off and on for the led's which are false and true respectively. Also, time for blink is a 2-element array.

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Aug 14 21:18:38 2014 +0000
@@ -0,0 +1,19 @@
+#include "mbed.h"
+#define LEDON false
+#define LEDOFF true
+
+// slightly more interesting blinky 140814 sc
+
+float blinks[]={0.200, 0.700};
+int ledState = LEDON;
+DigitalOut greenColor(LED_GREEN);
+DigitalOut redColor(LED_RED);
+
+int main() {
+    while(true) {
+        ledState = !ledState; // Flip the general state
+        redColor = ledState;
+        greenColor = !ledState;// flip state but don't store it.
+        wait(blinks[ledState]);
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Aug 14 21:18:38 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/04dd9b1680ae
\ No newline at end of file