Shop OBEX P1 Docs P2 Docs Learn Events
Help with BOE-Dar modification. — Parallax Forums

Help with BOE-Dar modification.

OfflinerOffliner Posts: 6
edited 2005-12-13 19:35 in Robotics
Hi all,
I·need someone who can·help me with a project I'm doing it now ,·I have bought a Boe-Bot full Serial kit and SureLink as it shown in this project done before by Phil Pilgrim http://www.parallax.com/html_pages/resources/custapps/app_Boe-Dar.asp
I·want to upgrade this kit to work as follow :
I·want my pc to be the controller for the robot so·I can send it the direction where to go and how to roam , by typing the commands at my pc and it will be sent back to the Boe-Bot by the Serial link .
I·need someone who can help me with programming and the design i must work with.

With All Respect

Offliner

Post Edited By Moderator (Chris Savage (Parallax)) : 12/12/2005 4:10:38 PM GMT

Comments

  • Phil PilgrimPhil Pilgrim Posts: 119
    edited 2005-12-13 19:35
    Hi,

    Without actually writing your code for you, I can offer these hints:

    1. Design a "command language" that the Boe-Bot can decode. This could be as simple as an exclamation point followed by a single letter, then a numerical parameter followed by a semicolon. For example,
    !F400;
    


    might mean, "Move forward 400 units."

    2. Put a SERIN statement to read the commands near the head of an infinite loop:
    SERIN spin, sbaud, [noparse][[/noparse]WAIT("!"), cmd, DEC param]
    


    This will wait for an exclamation point, read a single byte into the BYTE variable cmd, then a number into the WORD variable param. This is the reason for the semicolon: to flag that there are no more digits to read into param.

    3. Use a SELECT ... CASE construct with cmd as the "index" variable to dispatch to the correct section of code for each command.

    4. When you've finished executing the command, send an "okay" message back to the PC via SEROUT to tell it you're ready to accept another command. This probably should be put at the head of the loop before the SERIN. This message should consist of characters not in your command language to distinguish them from the commands that get echoed back to the PC from the Stamp. By putting the SEROUT at the top of the loop, the PC will also receive the "okay" whenever the Stamp resets.

    The steps outlined here describe a synchronous command protocol: i.e. receive-command, execute-command, acknowledge, receive-command ... etc. If you want to receive commands asynchronously, for example while the Boe-Bot is beng commanded to move, things get a lot more complicated. Such a protocol is beyond the scope of this discussion.

    I hope this helps get you started. Doing the rest on your own will be an excellent learning experience for you. Good luck with your project!

    -Phil

    Post Edited (Phil Pilgrim (PhiPi)) : 12/13/2005 7:43:18 PM GMT
Sign In or Register to comment.