Mark Schwarzer / Mbed 2 deprecated Schwarzer_A3_1_Timers

Dependencies:   mbed

Revision:
2:1692cf4dda7f
Parent:
1:60db0821e5bc
Child:
3:7952403aaae6
--- a/main.cpp	Tue Oct 06 14:35:03 2020 +0000
+++ b/main.cpp	Tue Oct 06 14:44:54 2020 +0000
@@ -5,20 +5,21 @@
 #include "mbed.h"
 
 Timer timerLED2;  //creat timer object
+Timer timerLED3;
 DigitalOut LEDOut2(LED2);
+DigitalOut LEDOut3(LED3);
 
 int main()
 {
     timerLED2.start(); //start timer counting
-
+    timerLED3.start();
+    
     while(1) {
         if (timerLED2.read_ms()>=200) { //check to see if time has been exceeded
             LEDOut2 = !LEDOut2;
             timerLED2.reset();  //reset the timer back to zero
-        }  //if timer
-
-        //if you had other code that you wanted to execute faster,
-        //you could put it here!
-        
-    } //while
-}
+        }  
+        if (timerLED3.read_ms()>=400) {
+            LEDOut3= !LEDOut3;
+            timerLED3.reset();  }
+}}