frdm ticker example for the Freescale freedom platform

Dependencies:   mbed

Fork of frdm_ticker by Freescale

Files at this revision

API Documentation at this revision

Comitter:
chris
Date:
Fri Oct 12 13:03:56 2012 +0000
Child:
1:bbb4d2753b6b
Commit message:
First commit

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-KL25Z.lib 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	Fri Oct 12 13:03:56 2012 +0000
@@ -0,0 +1,21 @@
+#include "mbed.h"
+
+Ticker tick;
+DigitalOut led1(LED_RED);
+DigitalOut led2(LED_GREEN);
+
+void flip()
+{
+    led2 = !led2;
+}
+
+int main()
+{
+    tick.attach(&flip, 0.7); // setup ticker to call flip led2 after 0.7 seconds
+
+    // spin in a main loop.
+    while(1) {
+        led1 = !led1;
+        wait (0.3); // flip led1 every 0.3 seconds
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-KL25Z.lib	Fri Oct 12 13:03:56 2012 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/emilmont/code/mbed-KL25Z/#0d4e7384bff6