led v3
Fork of LED by
LED.cpp@1:4513264e463e, 2017-01-26 (annotated)
- Committer:
- Hygde
- Date:
- Thu Jan 26 15:59:15 2017 +0000
- Revision:
- 1:4513264e463e
- Parent:
- LED.c@0:1ccc5328ef67
- Child:
- 2:d08b46f9050c
voila
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Hygde | 0:1ccc5328ef67 | 1 | #include "mbed.h" |
Hygde | 0:1ccc5328ef67 | 2 | #include "LED.h" |
Hygde | 0:1ccc5328ef67 | 3 | |
Hygde | 0:1ccc5328ef67 | 4 | DigitalOut myled1(LED1); |
Hygde | 0:1ccc5328ef67 | 5 | DigitalOut myled2(LED2); |
Hygde | 0:1ccc5328ef67 | 6 | DigitalOut myled3(LED3); |
Hygde | 0:1ccc5328ef67 | 7 | DigitalOut myled4(LED4); |
Hygde | 0:1ccc5328ef67 | 8 | |
Hygde | 0:1ccc5328ef67 | 9 | void LED_Blinking(DigitalOut LED, float duree){ |
Hygde | 0:1ccc5328ef67 | 10 | LED = 1; |
Hygde | 0:1ccc5328ef67 | 11 | wait(duree); |
Hygde | 0:1ccc5328ef67 | 12 | LED = 0; |
Hygde | 0:1ccc5328ef67 | 13 | wait(duree); |
Hygde | 0:1ccc5328ef67 | 14 | } |
Hygde | 0:1ccc5328ef67 | 15 | |
Hygde | 1:4513264e463e | 16 | void K1000(float duree){ |
Hygde | 1:4513264e463e | 17 | myled1=1; |
Hygde | 1:4513264e463e | 18 | myled2=1; |
Hygde | 1:4513264e463e | 19 | myled3=1; |
Hygde | 1:4513264e463e | 20 | myled4=1; |
Hygde | 1:4513264e463e | 21 | wait(duree); |
Hygde | 1:4513264e463e | 22 | myled1=0; |
Hygde | 1:4513264e463e | 23 | myled2=0; |
Hygde | 1:4513264e463e | 24 | myled3=0; |
Hygde | 1:4513264e463e | 25 | myled4=0; |
Hygde | 1:4513264e463e | 26 | wait(duree); |
Hygde | 1:4513264e463e | 27 | } |
Hygde | 1:4513264e463e | 28 | |
Hygde | 0:1ccc5328ef67 | 29 | void K2000(float duree){ |
Hygde | 0:1ccc5328ef67 | 30 | LED_Blinking(myled1,duree); |
Hygde | 0:1ccc5328ef67 | 31 | LED_Blinking(myled2,duree); |
Hygde | 1:4513264e463e | 32 | LED_Blinking (myled3,duree); |
Hygde | 0:1ccc5328ef67 | 33 | LED_Blinking(myled4,duree); |
Hygde | 0:1ccc5328ef67 | 34 | LED_Blinking(myled3,duree); |
Hygde | 0:1ccc5328ef67 | 35 | LED_Blinking(myled2,duree); |
Hygde | 0:1ccc5328ef67 | 36 | LED_Blinking(myled1,duree); |
Hygde | 0:1ccc5328ef67 | 37 | } |
Hygde | 0:1ccc5328ef67 | 38 | |
Hygde | 0:1ccc5328ef67 | 39 | void K3000(float duree){ |
Hygde | 0:1ccc5328ef67 | 40 | myled1 = 1; |
Hygde | 0:1ccc5328ef67 | 41 | wait(duree); |
Hygde | 0:1ccc5328ef67 | 42 | myled2 = 1; |
Hygde | 0:1ccc5328ef67 | 43 | wait(duree); |
Hygde | 0:1ccc5328ef67 | 44 | myled3 = 1; |
Hygde | 0:1ccc5328ef67 | 45 | wait(duree); |
Hygde | 0:1ccc5328ef67 | 46 | myled4 = 1; |
Hygde | 0:1ccc5328ef67 | 47 | wait(duree); |
Hygde | 0:1ccc5328ef67 | 48 | myled4 = 0; |
Hygde | 0:1ccc5328ef67 | 49 | wait(duree); |
Hygde | 0:1ccc5328ef67 | 50 | myled3 = 0; |
Hygde | 0:1ccc5328ef67 | 51 | wait(duree); |
Hygde | 0:1ccc5328ef67 | 52 | myled2 = 0; |
Hygde | 0:1ccc5328ef67 | 53 | wait(duree); |
Hygde | 0:1ccc5328ef67 | 54 | myled1 = 0; |
Hygde | 0:1ccc5328ef67 | 55 | wait(duree); |
Hygde | 0:1ccc5328ef67 | 56 | } |
Hygde | 0:1ccc5328ef67 | 57 | |
Hygde | 0:1ccc5328ef67 | 58 | void K4000(float duree){ |
Hygde | 0:1ccc5328ef67 | 59 | myled4 = 1; |
Hygde | 0:1ccc5328ef67 | 60 | wait(duree); |
Hygde | 0:1ccc5328ef67 | 61 | myled3 = 1; |
Hygde | 0:1ccc5328ef67 | 62 | wait(duree); |
Hygde | 0:1ccc5328ef67 | 63 | myled2 = 1; |
Hygde | 0:1ccc5328ef67 | 64 | wait(duree); |
Hygde | 0:1ccc5328ef67 | 65 | myled1 = 1; |
Hygde | 0:1ccc5328ef67 | 66 | wait(duree); |
Hygde | 0:1ccc5328ef67 | 67 | myled1 = 0; |
Hygde | 0:1ccc5328ef67 | 68 | wait(duree); |
Hygde | 0:1ccc5328ef67 | 69 | myled2 = 0; |
Hygde | 0:1ccc5328ef67 | 70 | wait(duree); |
Hygde | 0:1ccc5328ef67 | 71 | myled3 = 0; |
Hygde | 0:1ccc5328ef67 | 72 | wait(duree); |
Hygde | 0:1ccc5328ef67 | 73 | myled4 = 0; |
Hygde | 0:1ccc5328ef67 | 74 | } |