Vlad Cazan
/
2XbeeTest
Revision 0:c64f463c344f, committed 2009-09-27
- Comitter:
- vcazan
- Date:
- Sun Sep 27 22:43:10 2009 +0000
- Commit message:
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 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Sun Sep 27 22:43:10 2009 +0000 @@ -0,0 +1,33 @@ +// basic xbee example +// - take chars from the terminal, push them out xbee1 +// - listen on xbee2, and print value + 1 to terminal + +#include "mbed.h" + +Serial xbee1(p9, p10); +DigitalOut rst1(p11); + +Serial xbee2(p13, p14); +DigitalOut rst2(p15); + +Serial pc(USBTX, USBRX); + +int main() { + + // reset the xbees (at least 200ns) + rst1 = 0; + rst2 = 0; + wait_ms(1); + rst1 = 1; + rst2 = 1; + wait_ms(1); + + while(1) { + if(pc.readable()) { + xbee1.putc(pc.getc()); + } + if(xbee2.readable()) { + pc.putc(xbee2.getc() + 1); + } + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun Sep 27 22:43:10 2009 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/a0336ede94ce