STDin and STDout example

Dependencies:   mbed

Committer:
lmottola
Date:
Mon Mar 18 11:42:27 2019 +0000
Revision:
1:2f9d56e97f30
Parent:
0:8c4e69ec8e4d
Child:
2:677b83cb846c
Removed useless myLed object

Who changed what in which revision?

UserRevisionLine numberNew contents of line
lmottola 0:8c4e69ec8e4d 1 #include "mbed.h"
lmottola 0:8c4e69ec8e4d 2
lmottola 0:8c4e69ec8e4d 3 Serial pc(USBTX, USBRX);
lmottola 0:8c4e69ec8e4d 4
lmottola 0:8c4e69ec8e4d 5 int main() {
lmottola 0:8c4e69ec8e4d 6 char buffer[128];
lmottola 0:8c4e69ec8e4d 7
lmottola 0:8c4e69ec8e4d 8 pc.printf("Starting..\n");
lmottola 0:8c4e69ec8e4d 9
lmottola 0:8c4e69ec8e4d 10 while (1) {
lmottola 0:8c4e69ec8e4d 11 pc.gets(buffer, 4);
lmottola 0:8c4e69ec8e4d 12 pc.printf("I got '%s'\n", buffer);
lmottola 0:8c4e69ec8e4d 13 }
lmottola 0:8c4e69ec8e4d 14 }