CSCI 5360 JB_MB_BC / Mbed 2 deprecated Ticker_SquareWave_LED

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
mb4899
Date:
Tue Feb 17 11:44:05 2015 +0000
Commit message:
Uses two tickers to create square wave outputs to the LED's

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	Tue Feb 17 11:44:05 2015 +0000
@@ -0,0 +1,29 @@
+#include "mbed.h"
+
+Ticker flipper1;
+Ticker flipper2;
+DigitalOut myLED(LED1);
+DigitalOut myLED2(LED2);
+
+void flip1()
+{
+    myLED = !myLED;
+}
+
+void flip2()
+{
+    myLED2 = !myLED2;
+}
+
+int main()
+{
+    myLED = 0;
+    myLED2 = 0;
+    flipper1.attach(&flip1, 0.2);
+    flipper2.attach(&flip2, 1.0);
+
+    while(1)
+    {
+        wait(0.2);
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Feb 17 11:44:05 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9ad691361fac
\ No newline at end of file