Richard Kuo
/
NTOUEE-mbed-blinky-printf
NTOUEE mbed sample code : blinky LED1 & printf
main.cpp@0:548933a73419, 2016-10-18 (annotated)
- Committer:
- rkuo2000
- Date:
- Tue Oct 18 07:14:20 2016 +0000
- Revision:
- 0:548933a73419
NTOUEE mbed sample code : blinky LED1 & printf
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
rkuo2000 | 0:548933a73419 | 1 | #include "mbed.h" |
rkuo2000 | 0:548933a73419 | 2 | |
rkuo2000 | 0:548933a73419 | 3 | DigitalOut led1(LED1); |
rkuo2000 | 0:548933a73419 | 4 | |
rkuo2000 | 0:548933a73419 | 5 | int main() { |
rkuo2000 | 0:548933a73419 | 6 | while (true) { |
rkuo2000 | 0:548933a73419 | 7 | led1 = !led1; |
rkuo2000 | 0:548933a73419 | 8 | Thread::wait(500); |
rkuo2000 | 0:548933a73419 | 9 | printf("LED1=%d\n\r", led1); // please set UART baud rate = 9600 |
rkuo2000 | 0:548933a73419 | 10 | } |
rkuo2000 | 0:548933a73419 | 11 | } |