Xbee on Mega, Xbee on Boarduino - 2-way Comm.

Hi Everyone!
New around these parts...just getting into the arduino fad.

I've got a mega and xbee that I want under a certain condition to send a signal to a boarduino and different xbee. Once the boarduino and different xbee receives that signal, I would like the boarduino to enter a function. In that function there is a check for a button press. Once the button press is seen, I want to send a signal back to the mega and xbee.

That's it!

I am using the regular Serial on the mega for debugging as it currently connected to my machine vs. the boarduino and different xbee which is battery-powered. Looks like I should use Serial1 for the xbee.

The PANs are set to the same address. The TX to RX and vs. versa are wired on both. Looking for some guidance on the code logic here...

From my reading it looks like Serial.available looks to be the logical thing to check on the boarduino to see if a signal is being sent by the mega and xbee. And I should use Serial1 on the mega.

Anyone have any thoughts or tips on quick and dirty code/logic for what I am looking to do?

Thanks for taking a look at my post!!! ;D ;D :slight_smile: