Kohei Yamamoto
/
esptopc
esp and pc
Diff: main.cpp
- Revision:
- 0:7634421e8e46
- Child:
- 1:1a5cc6ebc608
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Dec 03 06:21:38 2021 +0000 @@ -0,0 +1,18 @@ +#include "mbed.h" + + +Serial pc(D1, D0); // tx,rx +Serial esp(A7, A2); + +int main() +{ + pc.printf("\nConnected to PC\n"); + while(1) { + if (esp.readable()){ + pc.printf("%c",esp.getc()); + } + if (pc.readable()){ + esp.printf("c",pc.getc()); + } + } +}