Shop OBEX P1 Docs P2 Docs Learn Events
Bluetooth for ignorami — Parallax Forums

Bluetooth for ignorami

KhiyaKhiya Posts: 6
edited 2009-03-24 23:48 in Robotics
Hi, I'm trying to understand how to implement communication between multiple boe-bots using a bluetooth eb500, and I'm clueless about where to start. (This is indeed a school project, so I'm just looking for understanding of the basic software, not to copy and paste someone else's code).· Although my computer doesn't have a bluetooth chip, I've tried connecting with a serial cable as directed in the manual I found at parallax (http://www.parallax.com/dl/docs/prod/comm/eb500UserManual.pdf) and I've downloaded Hyperterminal and tried that as well, but nothing comes up, and I've also tried several of the pbasic codes offered in the manual with the same result.
Is it even possible to program an eb500·using PBasic like you would an RF transmitter/reciever pair, or do I have to download other PC software as well? And is there a significant difference between an eb500-Ser and an eb500 A? (I have the A).
Any help at all would be much appreciated!
-Khiya

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-03-24 04:25
    The EB500 User Manual is pretty thorough with lots of examples, sample code, sample schematic diagrams, explanations. Last time I tried some of them, they worked as expected. It's not at all clear what you've tried to do, how you've tried to do it, or what happened. How about starting with a specific example? What are you trying to do? What did you try from the documentation ... exactly. What happened?

    The EB500 can furnish a bidirectional serial link between two devices (at a time) that, except for timing, looks like a wired connection. You can connect two BoeBots or one BoeBot and a PC and an EB500 can set up pair-wise connections among lots of Bluetooth serial links (two at a time).

    A7 is the developer/designer of the EB500. I think the EB500-SER and the EB500 are the same thing. I'm not aware of any difference except the name.
  • KhiyaKhiya Posts: 6
    edited 2009-03-24 15:47
    Sorry for the vagueness, I wrote that rather late last night. I want to just set up a connection between two (and hopefully more eventually) BOE-Bots so they can communicate, so I went to the Connecting two eb500 modules section of the eb500 manual. However, that set-up requires a sumoboard, which I'm not using. I went ahead and ran the provided pbasic code to get the address of an eb500 on a boe-bot:

    '{$STAMP BS2sx}
    szData VAR BYTE(20)
    'Wait for the eb500 radio to be ready
    PAUSE 1000
    'Get the eb500 Bluetooth Address
    SEROUT 1,252,[noparse][[/noparse]"get address",CR]
    SERIN 0,252,[noparse][[/noparse]WAIT(“ACK”,CR)]
    'Read the local address from the get command
    SERIN 0,252,[noparse][[/noparse]STR szData\17]
    SERIN 0,252,[noparse]/noparse]WAIT(CR,”>&#8221[noparse];)[/noparse
    szData(17) = 0
    DEBUG “Local eb500 address: “,STR szData\17,CR

    although I had to change the numbers a bit to make it apply to a BS2SX (the 252s were 84s). Debugging showed that the SEROUT command happens, but apparently the first SERIN never picks up any signal. I also tried it with the 252s changed to 240s, but I didn't see any change. I've run it several times with several different eb500s, and I've doublechecked my wiring, so I was hoping someone could tell me if I'm overlooking something terribly obvious that I just don't know about bluetooth connections.

    I also went ahead and tried establishing a PC-BoeBot connection using an eb600 and a serial cable, and I downloaded Hyperterminal as the manual says to. I followed all the connection steps on pages 7-9, but at step 22 on page 9, pressing enter did not make a carat appear in the hyperterminal window. I'm not very interested in a PC-BoeBot connection if I don't have to be. Does anyone know of another website that explains connecting to BOE-Bots with bluetooth?
    Thanks
    -Khiya
  • KhiyaKhiya Posts: 6
    edited 2009-03-24 22:54
    Also, could anyone tell me what

    SERIN 0,252,[noparse][[/noparse]WAIT("ACK",CR)]

    does exactly? What does the "ACK" mean?
  • Mike GreenMike Green Posts: 23,101
    edited 2009-03-24 23:48
    Read the description of the WAIT formatter in the chapter on the SERIN statement in the Stamp Manual. Essentially it waits either for the string "ACK" or the character CR which is a byte containing 13 (a carriage return).
Sign In or Register to comment.