Shop OBEX P1 Docs P2 Docs Learn Events
Robot Programs — Parallax Forums

Robot Programs

Xcelon619Xcelon619 Posts: 2
edited 2008-10-21 21:05 in BASIC Stamp
Hi Guys,
········ I'm pretty much need help or someone to point me in the direction on how to·program the Basic Stamp 2 chip to learn or record data. I'm currently· building a robot to run through a micro mouse maze and programming it to learn to run the first run and having it learn the wrong turns. When it run the second time it should be able to run in the right path and not take any wrong turns after learning in the 1st run. Can someone point me in the direction on how to program the Basic Stamp 2 chip. Thanks.

Comments

  • SRLMSRLM Posts: 5,045
    edited 2008-10-18 14:23
    Mostly, it will take a lot of hard word. The BS2 is really that well suited to AI (which is what you're looking for), so you'll need to find a way around it. My recomendation is that it recordes (in EEPROM, maybe) all the choices it makes, and if it makes a wrong choice it backs up and erases until it gets to the next choice, and tries the alternative. For values stored in the EEPROM, you could have

    0 = unused
    1 = left
    2 = forward
    3 = right
    4 = backward

    Then, you'll end up with a list of choices: 242452321132131. The hard part will be detecting when you can make a choice.
  • Ken GraceyKen Gracey Posts: 7,389
    edited 2008-10-18 14:35
    The Robotics with the Boe-Bot book includes many examples with writing and reading from EEPROM, and it's a free download. Even if you are not using a Boe-Bot, the example code is explained so completely you can port it to other kinds of motor control and systems. You should really start with the basic stuff, then build it one step at a time. Don't try to throw together a whole maze-solving robot until you've achieved basic movement.

    Ken Gracey
    Parallax, Inc.
  • Xcelon619Xcelon619 Posts: 2
    edited 2008-10-19 09:48
    Thanks. You guys are very helpful and at least I'm in the right direction.
  • morgandeomorgandeo Posts: 16
    edited 2008-10-21 21:05
    The BASIC Stamp I and II modules will work in 0° to 70° C temperatures with up to 70%, non-condensing
    humidity. While the modules may continue to function outside these ranges, it is not guaranteed or
    recommended by Parallax, Inc.
Sign In or Register to comment.