simple test prog for the esp8266 dongles
Dependencies: mbed
This is a simple version of the serial passthrough test code for the esp8266 connected to an LPC1768 mbed.
Revision 0:1f45dc9df1af, committed 2016-06-07
- Comitter:
- cstevens
- Date:
- Tue Jun 07 19:59:11 2016 +0000
- Commit message:
- fully comented workng version;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 1f45dc9df1af main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Tue Jun 07 19:59:11 2016 +0000 @@ -0,0 +1,26 @@ +#include "mbed.h" + +Serial pc(USBTX, USBRX); // tx, rx +Serial esp(PTA2,PTA1); + +int main() +{ + pc.baud(115200); + int i=0; + char c; + while(1) { + // pc.printf("Hello World! %d\n\r",i++); + //wait(0.5); + if(pc.readable()) { + c=pc.getc(); + pc.putc(c); + esp.putc(c); + } + if(esp.readable()) { + c=esp.getc(); + pc.putc(c); + + + } + } +} \ No newline at end of file
diff -r 000000000000 -r 1f45dc9df1af mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Jun 07 19:59:11 2016 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/6c34061e7c34 \ No newline at end of file