wang tang
/
LEDandButton
LED and button system
Fork of LED by
main.cpp
- Committer:
- e58136782000
- Date:
- 2017-10-20
- Revision:
- 2:7bb4b5066464
- Parent:
- 1:59cafc988b1c
- Child:
- 3:684d085cd132
File content as of revision 2:7bb4b5066464:
#include "mbed.h" DigitalOut led1(D4); DigitalOut led2(D5); DigitalOut led3(D6); DigitalIn button(D7); void LED_Blinkly(DigitalOut led1,DigitalOut led2,DigitalOut led3); // main() runs in its own thread in the OS int main() { while(1) { if(button == false) { led1 =! led1; wait(0.5); led2 =! led2; wait(0.5); led3 =! led3; wait(0.5); } else { led1 = false; led2 = false; led3 = false; } } }