Kohei Yamamoto / Mbed 2 deprecated esptopc

Dependencies:   mbed

main.cpp

Committer:
asha_ndf
Date:
2021-12-07
Revision:
1:1a5cc6ebc608
Parent:
0:7634421e8e46

File content as of revision 1:1a5cc6ebc608:

#include "mbed.h"


Serial pc(USBTX, USBRX); // tx,rx
Serial esp(D1, D0);

int main()
{
    pc.baud(19200);
    pc.printf("\nConnected to PC\n");
    while(1) {
        if (esp.readable()){
            pc.printf("%c",esp.getc());
        }
        if (pc.readable()){
            esp.printf("c",pc.getc());
        }
    }
}