The above adage is known around the world as “Read Teh F***ing Manual!” (‘teh’ was intentional), and just proved itself to me this evening. I’ve been trying to use Digi’s XBee wireless radio modules to communicate wirelessly via Arduino, and the documentation on this is absolutely horrible. There are a couple books that do a decent job of explaining it (Tom Igoe’s Making Things Talk is a great one) but still don’t have a clear explanation of how to use it for one’s own purposes. I intend to remedy this with a post coming soon, which explains further the exact process of getting this to work with my specific setup (Arduino Duemilanove and Sparkfun XBee USB adapter), but for now let me just be excited for a moment that I have succeeded in step one – reading the state of a button through an Arduino, then sending the serial message over XBee and into my computer.
The purpose of this endeavor is to mount two buttons on a dancer’s feet, then run a wire up to a little Arduino Lilypad and transmitting that via XBee to my computer. Unfortunately, there are no tutorials online, just success stories. It took me about 3 weeks to realize that the solution was to, as stated above, “RTFM!” and download the datasheet for the dang things, and low and behold, it contained all of the answers I needed. Well, most of them.
Using the datasheet, I was able to figure out how to send the right messages to the module (ATMY1234,WR for example, to set the receive address for the unit) and other ways to configure the thing. The datasheet also contains all the information on PWM signals, and how to utilize all the features the chips have to offer.
Of course, the whole point of this thing is that if I had just read the datasheet in the first place, I wouldn’t have had to wait so long to be successful at this, and would be much further along in my process. Oh, well. Step 2 is to receive the state of 2 buttons, and port the data into Max/MSP. Then I’ll be able to control sound files with them. When I get that taken care of, I’ll have to send commands to an LED or a motor or something. When I succeed at that, I’ll post a video.
Until then, I’ll work on my little XBee tutorial, and hopefully get this stuff done in time for my show on the 20th and 21st of November. Wish me luck!