help with boe-bot
MacGeek117
Posts: 747
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
everything. It jerks around when I turn it on. could someone please help? -bugg
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
Dave
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dave Andreae
Tech Support
dandreae@parallax.com
www.parallax.com
·
I hate to admit it but I got similar behavior when I had my left-right servos switched
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
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
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.
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.