ece4180_team / Mbed 2 deprecated Lab3PArt4

Dependencies:   mbed

Revision:
3:708851531127
Parent:
2:8b678520a9fb
diff -r 8b678520a9fb -r 708851531127 main.cpp
--- a/main.cpp	Fri Sep 30 20:46:33 2022 +0000
+++ b/main.cpp	Fri Sep 30 20:50:45 2022 +0000
@@ -1,6 +1,9 @@
 #include "mbed.h"
  
-Ticker flipper;
+Ticker flipper1;
+Ticker flipper2;
+Ticker flipper3;
+Ticker flipper4;
 DigitalOut led1(LED1);
 DigitalOut led2(LED2);
 DigitalOut led3(LED3);
@@ -21,12 +24,12 @@
 }
  
 int main() {
-    flipper.attach(&flip2, 2 ); // the address of the function to be attached (flip) and the interval (2 seconds)
-    flipper.attach(&flip1, 1);
-    flipper.attach(&flip3, 4);
-    flipper.attach(&flip4, 8);
+    flipper2.attach(&flip2, 2 ); // the address of the function to be attached (flip) and the interval (2 seconds)
+    flipper1.attach(&flip1, 1);
+    flipper3.attach(&flip3, 4);
+    flipper4.attach(&flip4, 8);
     // spin in a main loop. flipper will interrupt it to call flip
     while(1) {
       i++;
-        }
+    }
 }
\ No newline at end of file