Lab 3 part1

Dependencies:   mbed

Fork of Ticker_Example by mbed official

Files at this revision

API Documentation at this revision

Comitter:
ldeng31
Date:
Tue Oct 06 19:28:06 2015 +0000
Parent:
0:14eb5da7a9a3
Commit message:
Lab3 part 1 Ticker;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Tue Feb 19 15:58:42 2013 +0000
+++ b/main.cpp	Tue Oct 06 19:28:06 2015 +0000
@@ -13,16 +13,23 @@
     DigitalOut _pin;
 };
  
-DigitalOut led1(LED1);
-Flipper f(LED2);
-Ticker t;
+Flipper f_1(LED1);
+Flipper f_2(LED2);
+Flipper f_3(LED3);
+Flipper f_4(LED4);
+
+Ticker t_1;
+Ticker t_2;
+Ticker t_3;
+Ticker t_4;
  
 int main() {
-    t.attach(&f, &Flipper::flip, 2.0); // the address of the object, member function, and interval
- 
+    t_1.attach(&f_1, &Flipper::flip, 1.0); 
+    t_2.attach(&f_2, &Flipper::flip, 2.0); // the address of the object, member function, and interval
+    t_3.attach(&f_3,&Flipper::flip,3.0);
+    t_4.attach(&f_4, &Flipper::flip, 4.0); 
     // spin in a main loop. flipper will interrupt it to call flip
-    while(1) {
-        led1 = !led1;
-        wait(0.2);
-    }
+    while(1) 
+        {
+        }
 }