Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 9 months ago.
FRDM + xbee connection
Hi guys, i am totally new to this. I have just received my FRDM KL25Z board and i have attached an xbee series 2 on the PINs PTD3 (tx) PTD2(rx). I have configured my xbee as an Coordinator API. I have tried many different codes. However i haven't managed to speak to my xbee and receive a confirmation to my PC terminal port (Tera-Term) saying: "Data have been received ok". Could anyone help?
3 Answers
10 years, 9 months ago.
Hi Filippos,
Your code will work (I just ran your code), provided (as Erik states) your XBee modules are configured to run in transparent (e.g. AT) mode.
With the XBee's in API mode you must send them properly formatted API communication frames. Check page 98 of the Digi XBee Hardware Reference Manual (http://ftp1.digi.com/support/documentation/90000976_P.pdf) for more detailed information.
Regards, Cameron
10 years, 9 months ago.
I have written this code by the way. I don't know why it doesn' work:
- include "mbed.h"
Serial pc(USBTX, USBRX); tx, rx Serial xbee(PTD3, PTD2); tx, rx DigitalOut myled(LED1); int main() { char mychar; pc.printf("type anything you want to transmit to the local radio\n"); while (1) { if (pc.readable()) { mychar=pc.getc(); xbee.putc(mychar); } if (xbee.readable()) { mychar=xbee.getc(); pc.putc(mychar); myled = 1; } } }