Seongbin Lim
/
sb_first_project
This is a very simple guide, reviewing the steps required to get Blinky working on an Mbed OS platform.
Diff: main.cpp
- Revision:
- 114:376a5998ecf4
- Parent:
- 113:be6b329fe2d5
- Child:
- 115:07ea865ffb2d
--- a/main.cpp Mon Apr 13 09:56:56 2020 +0000 +++ b/main.cpp Mon Apr 13 10:00:30 2020 +0000 @@ -1,10 +1,11 @@ #include "mbed.h" -RawSerial pc(PA_2, PA_3, 115200); // USART2 +Serial pc(PA_2, PA_3, 115200); // USART2 +DigitalOut led(LED2); int main() { - pc.printf("\r\n Welcome to UART Lab_2_1!\r\n"); + pc.printf("\r\n Welcome to UART Lab_2_2!\r\n"); pc.printf("Enter characters..\r\n"); while(true) { @@ -12,9 +13,10 @@ int ch = pc.getc(); pc.putc(ch); if(ch == 0x0D) { - while(!pc.writeable()); pc.putc(0x0A); } + ThisThread::sleep_for(500); + led = !led; } } \ No newline at end of file