match your Boe-Bot and particular surface. For a triangle pattern, the Boe-Bot
must travel 1 meter/yard forward, then make a 120 degree turn. This should be
repeated three times for the three sides of the triangle. You may have to adjust
the
pulseCount EndValue
120 degree turn.
' Robotics with the Boe-Bot - Chapter 4 - Triangle.bs2
' Boe-Bot navigates triangle shape with 1 yard sides.
' Go forward, then turn 120 degrees.
'{$STAMP BS2}
'{$PBASIC 2.5}
DEBUG "Program running!"
counter
VAR
pulseCount
VAR
FREQOUT 4, 2000, 3000
Main:
FOR counter = 1 TO 3
GOSUB Forward
GOSUB Right_Rotate120
NEXT
END
Forward:
FOR pulseCount = 1 TO 163
PULSOUT 13, 850
PULSOUT 12, 650
PAUSE 20
NEXT
RETURN
Right_Rotate120:
FOR pulseCount = 1 TO 21
PULSOUT 13, 850
PULSOUT 12, 850
PAUSE 20
NEXT
RETURN
Chapter 4: Boe-Bot Navigation · Page 163
in the
Right_Rotate120
Repeat three times.
Nib
' Triangle has 3 sides
Word
' Pulse count to servos
' Signal program start/reset.
' Repeat 3 times for triangle
' Forward 1 yard
' Rotate right 120 degrees
subroutine to get a precise
Need help?
Do you have a question about the Boe-Bot and is the answer not in the manual?