Jan Boerman
/
Minor_test_serial
serial test
Fork of Minor_test_serial by
main.cpp
- Committer:
- Jankoekenpan
- Date:
- 2016-09-12
- Revision:
- 1:0f8ca2b9b866
- Parent:
- 0:c8f15874531b
File content as of revision 1:0f8ca2b9b866:
#include "mbed.h" DigitalOut myled(LED_GREEN); Serial pc(USBTX, USBRX, "YOLO"); int main() { pc.baud(115200); pc.printf("Hello World!\n"); while (true) { char c = pc.getc(); //get a character from the computer keyboard pc.printf("%c\r\n",c); //print the pressed character myled = !myled; // toggle the green LED } }