![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Nodo Receptor
Diff: main.cpp
- Revision:
- 0:1c46d2e5cca5
diff -r 000000000000 -r 1c46d2e5cca5 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Jun 15 04:00:46 2018 +0000 @@ -0,0 +1,31 @@ +#include "mbed.h" + +DigitalOut myled(LED1); +Serial xbee(p9,p10); +Serial pc(USBTX,USBRX); + + +int main() +{ + xbee.baud(115200); + pc.baud(230400); + while(1) + { + //if(pc.readable()==0){ + while(xbee.getc()!=0xFF){} + while(xbee.getc()!=0xFE){} + while(xbee.getc()!=0xC1){} + pc.printf("%02x",xbee.getc());1 + pc.printf("%02x",xbee.getc());2 + pc.printf("%02x",xbee.getc());3 + pc.printf("%02x",xbee.getc());4 + pc.printf("%02x",xbee.getc());5 + pc.printf("%02x",xbee.getc());6 + pc.printf("%02x",xbee.getc());7 + pc.printf("%02x",xbee.getc());8 + pc.printf("\n\r"); + xbee.getc(); + xbee.getc(); + xbee.getc(); + }//} +}