USB serial demo for an Android device See https://os.mbed.com/users/4180_1/notebook/using-mbed-with-an-android-phone-or-tablet/
See https://os.mbed.com/users/4180_1/notebook/using-mbed-with-an-android-phone-or-tablet/ for details
Diff: main.cpp
- Revision:
- 0:4236501a059a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Feb 08 14:58:45 2018 +0000 @@ -0,0 +1,16 @@ +#include "mbed.h" +//Communicate with Android using USB serial +//See https://os.mbed.com/users/4180_1/notebook/using-mbed-with-an-android-phone-or-tablet/ +DigitalOut myled(LED1); +Serial USB(USBTX,USBRX); + +int main() { + USB.baud(19200); //set baud for Andriod App default + wait(1.0); + USB.printf("\n\rHello from mbed\n\r"); + USB.printf("Type characters, hit send, and mbed will echo them back\n\r"); + myled = 1; + while(1) { + USB.putc(USB.getc()); + } +}