Welcome to EnviroDIY, a community for do-it-yourself environmental science and monitoring. EnviroDIY is part of WikiWatershed, an initiative of Stroud Water Research Center designed to help people advance knowledge and stewardship of fresh water.
New to EnviroDIY? Start here

Reply To: XBee Networks of Mayfly Loggers – 900Mhz

Home Forums Mayfly Data Logger XBee Networks of Mayfly Loggers – 900Mhz Reply To: XBee Networks of Mayfly Loggers – 900Mhz

Shannon Hicks

    Here’s some sample code that I just put together to demonstrate the code for waking and sleeping the Xbee. You’ll notice it’s a little more complicated than just setting the D23 pin high or low. That’s because the pin should be pulled high when you want to sleep the Xbee (like I mentioned in my previous post), and if you want to sleep the Mayfly (Mayfly sleep function not shown in the code below), you’ll want to enable the input pullup so the Mayfly pin still looks high to the Xbee unit, otherwise when the Mayfly sleeps, the Xbee won’t get the HIGH signal needed to keep it asleep and will therefore wake up.

    It’s also a good idea to leave a few seconds before and after your payload transmission to give the Xbee network adequate time to do the behind-the-scenes payload transmission stuff.