Mark Schwarzer / Mbed 2 deprecated Schwarzer_A4_1_Interrupts

Dependencies:   mbed

Revision:
1:fdcb0bfe75b7
Parent:
0:6b2314a40652
Child:
2:39e295fcc23d
diff -r 6b2314a40652 -r fdcb0bfe75b7 main.cpp
--- a/main.cpp	Mon Oct 12 23:21:55 2020 +0000
+++ b/main.cpp	Mon Oct 12 23:22:33 2020 +0000
@@ -31,4 +31,21 @@
     LEDOut3 = !LEDOut3;
 }
 
+int second()
+{
+    tickerLED1.attach(&changeLED1,0.2); //the address of the function to call
+    //and the interval in seconds between
+    //calls to that function
+    tickerLED3.attach(&changeLED3,0.8); //changing the interval in seconds for LED3
 
+    while(1) {
+        wait(0.1);
+        wait(0.1);
+        wait(0.1);
+        wait(0.1);
+        wait(0.1);
+        //the main loop is spinning every 500ms, but the LED needs to go faster!
+    } //while
+}
+
+