Anh Quan
/
blink_led
blink_led
Revision 0:d833802907f3, committed 2018-07-12
- Comitter:
- anhquan
- Date:
- Thu Jul 12 03:25:18 2018 +0000
- Commit message:
- blink_led
Changed in this revision
blink_led.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
--- /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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Jul 12 03:25:18 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/a7c7b631e539 \ No newline at end of file