Lee Nam Cheol
/
lab01-led1-flash-sos
lab01-led1-flash-sos
Diff: main.cpp
- Revision:
- 0:cefd298b2e85
diff -r 000000000000 -r cefd298b2e85 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Apr 12 09:25:52 2020 +0000 @@ -0,0 +1,32 @@ +/* mbed Microcontroller Library + * Copyright (c) 2019 ARM Limited + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "mbed.h" + +// Blinking rate in milliseconds + +DigitalOut led1(LED1); + +int main() +{ + int i; + + while (true) { + for(i = 0; i<3; i++) { + led1 = 0; //led on + thread_sleep_for(300); + led1 = 1; //led off + thread_sleep_for(300); + } + thread_sleep_for(1000); + for(i=0; i<3; i++) { + led1 = 0; + thread_sleep_for(1000); + led1 = 1; + thread_sleep_for(300); + } + thread_sleep_for(1000); + } +} \ No newline at end of file