PDA

View Full Version : xbee programming help



Annoying
03-30-2010, 11:46 AM
So I just got two xbees and an·adapter that regulates the 5 V supply from the BS2 to 3.3 V, and now I am confused about how to program it. I·have questions about·the sample code on the parallax 5 V/3.3 adapter:

RX········ PIN·· 6························· ' XBee DOUT pin
PbState··· VAR·· Bit························ ' Variable space for pushbutton state
DO
· SERIN RX, 84, [BIN PbState]··············· ' Receives pushbutton state
· DEBUG HOME, ? PbState····················· ' Displays state in Debug Terminal
· IF PbState = 1 THEN HIGH 13 ELSE LOW 13··· ' LED on if pressed/off if not pressed
LOOP····

I am trying to transmit accelerometer data and I thought I could just modify this code and it would work, but that's not the case.
What is the BIN command for, is it always necessary? I am completely new to this. Is PbState always the·parameter in the SERIN command? Is there any "configuration" I need to do?
Thanks!

sylvie369
03-30-2010, 05:35 PM
All of your questions will be answered right here:

http://selmaware.com/appbee/AppBee_Doc.PDF

Work your way through the code examples in this document, and you'll be an XBee Pro.

Annoying
03-31-2010, 03:11 AM
thank you, that looks really helpful! so hard to find...