Anh Quan
/
blink_led
blink_led
Diff: blink_led.cpp
- Revision:
- 0:d833802907f3
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/blink_led.cpp Thu Jul 12 03:25:18 2018 +0000 @@ -0,0 +1,20 @@ +#include "mbed.h" + +DigitalOut gpo(D0); +DigitalOut led(LED_RED); +DigitalOut led2(LED_GREEN); + +int main() +{ + while(1) { + gpo = !gpo; // toggle pin + for(int i =0 ; i< 5 ; i++) { + led = !led; // toggle led + wait(0.2f); + } + for(int i =0 ; i<5 ; i++) { + led2 = !led2; + wait(0.2f); + } + } +} \ No newline at end of file