echo characters typed on USB debug port
Dependencies: mbed
Diff: main.cpp
- Revision:
- 0:279c532226c8
- Child:
- 1:43abfdd0709b
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Dec 02 16:11:54 2015 +0000 @@ -0,0 +1,14 @@ +// this program echos on the USB debug port + +#include "mbed.h" + +int main() { + Serial usb(USBTX, USBRX); + + // change the following value to change the baud rate + usb.baud(115200); + + while (true) + if (usb.readable()) + usb.putc(usb.getc()); +} \ No newline at end of file