So I have a copy of Wireless Sensor Networks and using knowledge gained from that book, I have successfully created a working Xbee series 2 network.
I have one Xbee connected to an Arduino Leonardo and configured as a coordinator. I have a second Xbee on a breadboard configured as an endpoint. It has a switch connected to D0 and is configured to send that switch state to the coordinator.
The Leonardo has a program listening for packets and decodes the D0 pin state and toggles an LED to follow the button press. Push the momentary button and the LED comes on, release and it goes off. So far so good.
What I want, however, is for the endpoint to have one button and do the same thing, except I want it to sleep between button presses. That is I want the button to wake it and send the data. Thing "garage door opener" with the Xbee and a battery and a switch and the ability to preserve battery life.
Well, I don't really care about "the data." The data is "someone pressed the button." If someone presses the button, I need to trip a digital output from low to high for a few tenths of a second, then shut it back off. That's it. Well, I say that, but I would actually like to potentially have a few buttons that do different things, so I do care about "the data", too.
I tried putting the end point in pin wake mode and tying the same switch output to pin wake, but I get weird behavior when I do that. Which I kind of expected. I'm guessing there's a way to do what I want, it just requires some more work. Any pointers? The book seems to run out of steam here...
--Donnie