STDin and STDout example

Dependencies:   mbed

main.cpp

Committer:
lmottola
Date:
2018-11-08
Revision:
0:8c4e69ec8e4d
Child:
1:2f9d56e97f30

File content as of revision 0:8c4e69ec8e4d:

#include "mbed.h"

DigitalOut myled(LED1);
Serial pc(USBTX, USBRX);

int main() {
    char buffer[128];

    pc.printf("Starting..\n");

    while (1) {
        pc.gets(buffer, 4);
        pc.printf("I got '%s'\n", buffer);
    }
}