wang tang
/
LEDandButton
LED and button system
Fork of LED by
Diff: main.cpp
- Revision:
- 0:6e75cf3220cb
- Child:
- 1:59cafc988b1c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Oct 19 12:36:02 2017 +0000 @@ -0,0 +1,21 @@ +#include "mbed.h" + +DigitalOut led1(D4); +DigitalOut led2(D5); +DigitalOut led3(D6); +void LED_Blinkly(DigitalOut led1,DigitalOut led2,DigitalOut led3); +// main() runs in its own thread in the OS +int main() { + LED_Blinkly(led1, led2, led3); +} +void LED_Blinkly(DigitalOut led1,DigitalOut led2,DigitalOut led3){ + while(true){ + led1 =! led1; + wait(0.5); + led2 =! led2; + wait(0.5); + led3 =! led3; + wait(0.5); + } +} +