Basic setup for Mega 2560 and XBee

Hi all :slight_smile:

I'm just getting started working with the Arduino Mega and a XBees. Eventually I'm looking to send and receive multiple input/output data but I'm just getting started and trying to setup basic communications.

I do not have the XBee shields but I am using the USB adapter board so I have XCTU working between the XBee's(I got them to talk to each other in the terminals). So my dilemma is I'm not familiar with the Arduino coding and the built in examples dont make sense for my application.

I started with one XBee connected to the USB adapter so I can view the terminal and the other connected to the Arduino. I've tried a few simple serial commands but no data transfers. Can anyone help with the basics here?

After I establish the basics I can manipulate the data I'll be sending and then be able to transfer it through the serial link.

Many thanks,
Mlee49

I do not have the XBee shields but I am using the USB adapter board so I have XCTU working between the XBee's

You don't have the USB adapter board connected to the Mega. So, how IS the XBee connected to the Arduino?

Simplest setup: your XBee is mounted on a breadboard using a breakout board (Breakout Board for XBee Module - BOB-08276 - SparkFun Electronics or similar). Power is connected to the 3.3V output of the Arduino, and Ground attached to one of the Arduino's ground pins. TX or DOUT on the XBee gets connected to RX on the Arduino. And RX or DIN on the XBee gets connected to TX on the Arduino.

Now Serial.read() should show each byte coming from your receiving XBee.

We've been talking inside Digi about launching a library of XBee examples for innovators. I'd be interested to hear if people are interested in seeing such a thing, and what examples might be most useful to start with.