Shop OBEX P1 Docs P2 Docs Learn Events
help with boe-bot — Parallax Forums

help with boe-bot

MacGeek117MacGeek117 Posts: 747
edited 2005-01-03 19:36 in BASIC Stamp
I programmed my boe-bot to detect objects with ir headlights but it seems paranoid of
everything. It jerks around when I turn it on. could someone please help? -bugg rolleyes.gif

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-12-30 00:45
    You'll get more help if you post your code -- most of the time these errors have to do with programming.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • dandreaedandreae Posts: 1,375
    edited 2004-12-30 18:37
    I have sometimes noticed that if you don't push in the IR LED into the socket all the way, that it will behave like this.· You should feel a snap or here a click when putting together the IR LED assembly.

    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Tech Support
    dandreae@parallax.com
    www.parallax.com

    ·
  • Michael ZieglerMichael Ziegler Posts: 2
    edited 2004-12-30 20:08
    Bugg,

    I hate to admit it but I got similar behavior when I had my left-right servos switchedfreaked.gif
  • MacGeek117MacGeek117 Posts: 747
    edited 2005-01-01 19:14
    DO
    FREQOUT 8, 1, 38500
    irleft = IN9

    FREQOUT 2, 1, 38500
    irright = IN0

    IF IN5 = 0 AND IN7 = 0 THEN
    HIGH 0
    HIGH 15
    GOSUB BACK_UP
    LOW 0
    LOW 15
    GOSUB TURN_LEFT
    GOSUB TURN_LEFT
    ELSEIF IN5 = 0 THEN
    HIGH 15
    GOSUB BACK_UP
    LOW 15
    GOSUB TURN_RIGHT
    ELSEIF IN7 = 0 THEN
    HIGH 0
    GOSUB BACK_UP
    LOW 0
    GOSUB TURN_LEFT
    ELSE
    GOSUB FORWARD_PULSE
    ENDIF
    LOOP

    Sorry Jon. I forgot that I put that in there.
    That is code for turning on the indicator LEDs.
    For the gosubs,

    forward_pulse:
    pulsout 13, 850
    pulsout 12, 650
    return

    turn_left:
    for pulsecount = 0 to 20
    pulsout 13, 650
    pulsout 12, 650
    nextreturn

    turn_right:
    for pulsecount = 0 to 20
    pulsout 13, 850
    pulsout 12, 850
    next
    return

    back_up:
    for pulsecount = 0 to 40
    pulsout 13, 650
    pulsout 12, 850
    next
    return
  • MacGeek117MacGeek117 Posts: 747
    edited 2005-01-01 19:17
    That last reply is the code for my boe-bot.--bugg
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-01-01 19:29
    Can you please attach the WHOLE program to a message -- don't paste into a post.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-01-03 14:58
    Bugg, you MUST have a 20 mSec delay between PULSOUT statements.
    As written, I see no PAUSE statements of any kind. The Servo control signal is a variable width pulse, repeated every 20 mSec to 50 mSec. You are missing the 20 mSec delay.
  • MacGeek117MacGeek117 Posts: 747
    edited 2005-01-03 18:19
    sorry about that. I forgot to put those in there. -bugg
  • edited 2005-01-03 19:36
    Leave this the same:

    FREQOUT 8, 1, 38500
    irleft = IN9

    FREQOUT 2, 1, 38500
    irright = IN0

    You will probably need to replace all instances of IN5 with irleft and all instances of IN7 with irright.

    There is a working circuit and code example in Robotics with the Boe-Bot that is similar to what you are trying to do. It's in Chapter 7, Activity 4. You can probably compare it to what you have written and get the bugs out that way. The book is available for free download from www.parallax.com -> Downloads -> Stamps in Class Tutorials.
Sign In or Register to comment.