Shop OBEX P1 Docs P2 Docs Learn Events
Boe-Bot Maze Navagation — Parallax Forums

Boe-Bot Maze Navagation

zBusterzBuster Posts: 7
edited 2009-02-06 02:34 in Learn with BlocklyProp
does anyone have a simple sample program for the BS2 Boe-Bot that allows it to travel through a maze and remember which way it traveled so that it can just go the shortest path after it did the maze once?

I currently have:

irDetectLeft VAR Bit
irDetectRight VAR Bit
pulseLeft VAR Word
pulseRight VAR Word

FREQOUT 4, 2000, 3000

DO

FREQOUT 8, 1, 38500
irDetectLeft = IN9
FREQOUT 2, 1, 38500
irDetectRight = IN0

IF (irDetectLeft = 0) AND (irDetectRight = 0) THEN
pulseLeft = 650
pulseRight = 850
ELSEIF (irDetectLeft = 0) THEN
pulseLeft = 850
pulseRight = 850
ELSEIF (irDetectRight = 0) THEN
pulseLeft = 650
pulseRight = 650
ELSE
pulseLeft = 850
pulseRight = 650
ENDIF

IF (IN15 = 1) THEN
LOW 14
ELSE
HIGH 14
ENDIF

PULSOUT 13,pulseLeft
PULSOUT 12,pulseRight

LOOP

How would this be changes to incorporate the maze ability....
I only ask here cuz I cannot find a sample program anywhere.....lol
I really wana learn this an usually I gotta see one correct example to make my own setup later....

Thankz,

zBuster

Comments

  • P!-RoP!-Ro Posts: 1,189
    edited 2009-01-31 01:33
    I don't have any sample code but I do have advice. To make your code easier for you and others to understand I would use more variables and constants as well as documentation. I made the same mistakes when I was a beginner (year ago). Also, to help you figure out the code for yourself instead of bumming off of others (which I do all to often myself) try writing down your ideas on a piece of paper or run them through your head. Think of ways you can make the boe-bot do what you would like. Once you know how you want to do in think of how you can make it happen in pbasic and figure things one SUB at a time. Test each one and put it together to make your program.

    Also, if you are fairly new to programming and don't know many commands for pbasic, try reading the syntax guide and all the different commands. Scan through the ones you haven't heard about and read what they do. Then think about how it might be used to accomplish your task. It may take some more time, but in the end it will make you a better programmer.

    Good luck!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PG
  • Mike GreenMike Green Posts: 23,101
    edited 2009-01-31 17:01
    You're asking for a simple sample program and that task that you want to do is not simple. At the very least, you need to have your program remember which way it moved (typically right, left or straight ahead) and for how long in order to be able to "replay" its movements through the maze. At the end of this path, your program has to have the bot explore the current position looking for choices for movement (like an opening on the side). All of this has to be recorded (typically in the EEPROM) using WRITE statements.
  • SANJAY RAMSANJAY RAM Posts: 1
    edited 2009-02-06 02:27
    Hey, everybody I was just wondering if anyone had a sample program for navigating a maze with touch sensors.
  • MovieMakerMovieMaker Posts: 502
    edited 2009-02-06 02:34
    Robot Programmer's Bonanza book has a maze navigation program in it. It has a simulated robot that does amazing things on the screen. The author claims that it only takes a few easy steps to change from the screen to an actual robot. You would have to setup a RC control system that is available for the boebot. You have to hook the boebot up to your pc and let the pc do the work and communicate to the boebot. But, this is not using the basicstamp2 brains for the smarts, it is using your pc. But, it will get the job done none the less. I suggest reading this book as it has a lot of useful information in it.

    lol.gif
Sign In or Register to comment.