Page 160 · Robotics with the Boe-Bot
Solutions
Q1. Left wheel counterclockwise, right wheel clockwise.
Q2. The right wheel is turning clockwise (forward), and the left wheel is not
moving.
PULSOUT 13, 750
PULSOUT 12, 650
Q3. You can slow down the right wheel to correct a veer to the left. The PULSOUT
command for the right wheel needs to be adjusted.
PULSOUT 12, 650
Adjust the 650 to something closer to 750 to slow the wheel down.
PULSOUT 12, 663
Q4. Given:
Boe-Bot speed = 11 in/s
Boe-Bot distance = 36 in/s
pulses = (Boe-Bot distance / Boe-Bot speed) * (40.65 pulses / s)
= (36 / 11 ) * (40.65)
= 133.04
= 133
It should take 133 pulses to travel 36 inches.
Q5. The
FOR…NEXT loop's pulseCount variable can be used as an offset (plus or
minus) to 750 (the center position) in the
Duration argument.
FOR pulseCount = 1 to 100
PULSOUT 13, 750 + pulseCount
PULSOUT 12, 750 – pulseCount
PAUSE 20
NEXT
Q6. The DATA directive.
Q7. The
READ command.
Q8.
SELECT...CASE...ENDSELECT.
Q9.
UNTIL and WHILE.
E1.
FOR counter = 1 to 350 ' Backward
PULSOUT 13, 650
PULSOUT 12, 850
PAUSE 20
NEXT
E2. FOR counter = 1 to 8 ' Rotate right 30 degrees
PULSOUT 13, 850