Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: Xbee.cpp
- Revision:
- 20:f7abfda12a41
- Parent:
- 19:4bc3e2e68495
- Child:
- 21:bb89b0fca63d
--- a/Xbee.cpp Sat Nov 28 04:14:05 2015 +0000 +++ b/Xbee.cpp Sat Nov 28 04:26:09 2015 +0000 @@ -1,6 +1,8 @@ #pragma once #include "Xbee.h" +Serial pc(USBTX, USBRX); + Xbee::Xbee(PinName tx, PinName rx , PinName rst):_xbee(tx,rx),_rst(rst) { _xbee.baud(9600); @@ -21,10 +23,17 @@ { _xbee.putc('.'); _xbee.putc(buffer); - if(_xbee.getc() == '.') + + if(_xbee.readable()) { - break; + if(_xbee.getc() == '.') + { + break; + } } + + + wait(0.5); } }