Hi Vlad,
I haven't got one of these in front of me, but just had a look at the datasheet and this might help get you started:
First, the wiring. Main thing looks like power, serial and the reset. e.g.
1 VCC -------------- 3.3v
2 DOUT ------------- mbed serial rx (e.g. p10)
3 DIN -------------- mbed serial tx (e.g. p9)
4 not connected
5 RESET ------------ mbed digital out (e.g p11)
6-9 not connected
10 GND ------------- 0v/GND
11-20 not connected
Then, get it doing something. An example using two xbees (totally untested!):
// 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);
}
}
}
Hope this gets you started!
Simon
Hey
Just got my mbed today and im loving it. I was just wondering if anyone knows if the mbed would support the xbee system. I have two xbees and I really want to see if I can get them talking through the mbed.
Any ideas?