This is a very simple guide, reviewing the steps required to get Blinky working on an Mbed OS platform.

Dependencies:   RemoteIR

main.cpp

Committer:
sb8718
Date:
2020-04-13
Revision:
114:376a5998ecf4
Parent:
113:be6b329fe2d5
Child:
115:07ea865ffb2d

File content as of revision 114:376a5998ecf4:

#include "mbed.h"

Serial pc(PA_2, PA_3, 115200); // USART2
DigitalOut led(LED2);

int main() {

    pc.printf("\r\n Welcome to UART Lab_2_2!\r\n");
    pc.printf("Enter characters..\r\n");
    
    while(true) {
        
        int ch = pc.getc();
        pc.putc(ch);
        if(ch == 0x0D) {
            while(!pc.writeable());
            pc.putc(0x0A);
        }
        ThisThread::sleep_for(500);
        led = !led;
    }
}