Shop OBEX P1 Docs P2 Docs Learn Events
XBee Test Programs for the BS2 and Propeller — Parallax Forums

XBee Test Programs for the BS2 and Propeller

Daniel HarrisDaniel Harris Posts: 207
edited 2011-09-07 13:11 in Accessories
Hello All!

I have here some test programs I wrote that allow you to simply control a BOE-Bot (or any other robot) wirelessly with the XBee modules. It works by sending bytes to your XBee enabled robot which interprets them and controls the motors. This demo is suitable for both Series 1 and Series 2 XBees (the Series 2 have to already be configured to communicate with each other).

Once again, its a very simple demo :D.

Comments

  • zappmanzappman Posts: 418
    edited 2010-10-16 07:21
    Hi Daniel,

    It was nice chatting with you during the Savage Circuits chat last night (10-15-2010).

    I want thank you for posting your "XBee Robot Control Test Programs for the BS2 and Propeller".

    Both programs will help me to learn how to control my robot, using my recently purchased XBee Series 1 modules.

    Regards,

    zappman
  • Daniel HarrisDaniel Harris Posts: 207
    edited 2010-10-18 16:29
    Hello Zapp,

    Yes, it was good chatting with you too. I really enjoy hearing about and seeing what other people are doing. Im constantly amazed at the diverse ideas diverse people come up with :).

    The cool thing about those two programs (especially since you are coming from the BS2 to the Propeller) is that they are functionally identical. The code goes through the same operations for each micro controller. This way, you can line the two programs up side by side and go through line by line and learn how to program that way.

    Thats how I learned to program the Propeller.

    Anyway, as always, lemme know if you have any questions.

    Thanks,
    Daniel
  • zappmanzappman Posts: 418
    edited 2010-10-24 14:47
    Hello Daniel,

    I got my XBee Modules communicating today 10/24/2010, and I tried the xbee-demo-1_0.spin program which you posted.

    I had trouble steering my BOE-BOT, it would not turn left, it went forward instead.

    I have revised the program so that it works on my BOE-BOT.

    I have uploaded the file xbee-robot-demo-1_1.spin

    Regards,

    zappman
  • kolaikolai Posts: 9
    edited 2010-11-05 03:22
    Hello Daniel,

    I was wondering if the Xbee module would work if it would be used for navigation purposes, using the Memsic 2125 Dual-axis Accelerometer (It would be used as a Rf controller for the boe-bot). Like this one

    http://forums.parallaxinc.com/forums/default.aspx?f=6&m=61251

    instead of using the 433 Mhz RF tranceiver you will be using Xbees.

    Thanks:confused:
  • RiftRift Posts: 13
    edited 2010-12-30 00:08
    Quite awhile ago I made a post about using an Xbee on the Boe Bot but I never quite did solve the issue and put it of for quite awhile up until now. Iv recently gotten back into the swing of things and was hopping to get some help on the matter.

    I have an AppBee board that you can plug an Xbee into which then gets plugged directly into the Boe Bot. I was hoping to get this program to work with it so that i can remote control the Boe Boat. But thus far I am unable to get it to work. I wanted to make sure I am doing a few things right. Firstly am I correct that the Xbees should be set to 9600 Baud rate? Also to input the actual commands is using the debug window in the Basic Stamp software the way to go or do I use something else? So far I think these are my main two hurdles. But whatever I do doesn't seem to work.

    The AppBee board I'm using is the following
    http://www.selmaware.com/appbee/appBee-Mod_large.JPG

    and the Xbees are the Pro 60mw versions.

    Not looking to hijack the thread or anything, but I'm just trying to figure out a way to use your code with the hardware that I have.
  • RiftRift Posts: 13
    edited 2011-01-01 00:52
    Well I finally figured it out. The pins were set wrong as well as the BAUD for the actual port on the computer. Works great now.

    Thanks again for the code!
  • graffixgraffix Posts: 389
    edited 2011-02-12 12:24
    oh man thanks for the code. bs2 version.Its just what i was looking for.
  • miketoomiketoo Posts: 8
    edited 2011-09-04 05:09
    Hello Daniel,

    I'm relatively new to the the XBee world having just installed the Flash Fly modules on my BOE-BOT. I am able to download and run programs remotely from the Stamp Editor.
    So I now want to venture out into the XBee programming world. I purchased the "Getting Started with XBee RF Modules", and loaded the test program found on page 44 of
    the book. I've entered the program using the Stamp Editor and it loads without error, however; I do not get the Stamp Editor Terminal screen and nothing appears to be happening.
    If I open the X-CTU terminal, there's no activity there either. In the book, it appears the counter values are displayed on the X-CTU Terminal screen.

    I'm sure I've missed a step somewhere. I also loaded your xbee_demo.bs2 file (from this forum) and get the same behavior. Should I be loading the code from the X-CTU
    application (although I'm not sure how I would do that)? I've also noticed that with the X-CTU app running, the Stamp Editor can't "see" the Basic Stamp module and if I try
    to "Identify" it from the Stamp Editor, it reports it "can't open port; in use". What step have I missed?
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2011-09-04 05:35
    Miketoo,
    I'm not sure why the DEBUG window isn't opening, if DEBUG is in the code, ti should open.

    Keep in mind the Flash Fly system is a a remote programming system, not a simple link for XBee's, like the XBee adapter boards provide. I've not used the Flsh Fly yet, but I imagine there's some difference in use.

    -Martin
  • miketoomiketoo Posts: 8
    edited 2011-09-04 08:16
    Thanks Martin,

    Actually, there are NO DEBUG statements in the code. The code uses SEROUT to send messages
    to the Base Module from the Remote Module. Flash Fly is essentually two XBee modules and a USB
    adapter for the Stamp. They are working fine when sending Stamp BASIC code to the BOE-BOT from
    the Stamp Editor... it is when I load a prog. into the Stamp that tries to send a message from the
    BOE-BOT back to the Stamp Editor terminal through the SEROUT command. The code example
    shows the response back from the Remote Module being displayed in the X-CTU Terminal windiw. :smile:
  • Blue WolfBlue Wolf Posts: 7
    edited 2011-09-04 19:17
    Hi Miketoo,

    Please keep in mind, that while the FlashFly system does provide a simple XBee link using the modules, all the serial communicaiton is actually done through the Stamp's main serial IN and serial OUT port... This is why you can actually program the BASIC Stamp, or just use the FlashFly system as a general purpose wireless link. In the test program you were refering to, I believe they were using pins 15 for RX and pins 14 for TX. When using the FlashFly system, you will have to change those pin numbers to "16" in order to send (re-direct)the data out/in through the Stamp's main serial port. Another approach would be that of just using the DEBUG commands instead of the SEROUT/SERIN commands since these are related to the main serial port on the Stamp anyway. Please note that when you have the Stamp editor software up, and the X-CTU software up, only one of the programs can use the same serial port on your computer at a time (the one with the base module attached to it), that could be why you couldn't open the port? Hope that helps a little!
  • miketoomiketoo Posts: 8
    edited 2011-09-05 04:18
    YES! Very helpful. I changed the pin to 16 and replaced the SERIN/SEROUT with
    DEBUG. Serial Comm is now working. Thank you very much :thumb:
  • Blue WolfBlue Wolf Posts: 7
    edited 2011-09-07 13:11
    Great! I'm glad that helped!
Sign In or Register to comment.