USB serial demo for an Android device See https://os.mbed.com/users/4180_1/notebook/using-mbed-with-an-android-phone-or-tablet/

Dependencies:   mbed

See https://os.mbed.com/users/4180_1/notebook/using-mbed-with-an-android-phone-or-tablet/ for details

main.cpp

Committer:
4180_1
Date:
2018-02-08
Revision:
0:4236501a059a

File content as of revision 0:4236501a059a:

#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());
    }
}