TimerLed

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
happy_alien
Date:
Mon Dec 16 17:18:22 2019 +0000
Parent:
0:28ab61836d38
Commit message:
timerLed

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Mon Dec 09 11:17:47 2019 +0000
+++ b/main.cpp	Mon Dec 16 17:18:22 2019 +0000
@@ -5,8 +5,9 @@
 DigitalOut led1(LED1);
 DigitalOut led2(LED2);  // NUCLEO D2
 DigitalOut led3(LED3);  // NUCLEO D3
+DigitalOut led4(LED4);
  
-Ticker t1;
+Ticker t1,t3;
 Timeout t2;
 InterruptIn btn(BUTTON1);
  
@@ -14,7 +15,13 @@
     printf("Ticker fired\n");
     led1 = !led1;
 }
- 
+void blink_led4() 
+{
+    led4=!led4;
+    
+    
+    
+}
 void toggle_led2() {
     printf("BUTTON1 fall invoked\n");
     led2 = !led2;
@@ -32,6 +39,7 @@
  
     t1.attach(callback(&blink_led1), 1.0f);
     t2.attach(callback(&turn_led3_on), 2.5f);
+    t3.attach(callback(&blink_led4),5.0f);
     btn.fall(callback(&toggle_led2));
  
     while(1) {}