The
,
Turn_Left
Turn_Right
the
subroutine has a twist. It just sends one pulse, then returns. This is
Forward_Pulse
really important, because it means the Boe-Bot can check its whiskers between each
forward pulse. That means the Boe-Bot checks for obstacles roughly 40 times per second
as it travels forward.
Forward_Pulse:
PULSOUT 12,650
PULSOUT 13,850
PAUSE 20
RETURN
Since each full speed forward pulse makes the Boe-Bot roll around half a centimeter, it's
a really good idea to only send one pulse, then go back and check the whiskers again.
Since the
statement is inside a
IF...THEN
, it gets to
Forward_Pulse
then? The
statement checks the whiskers all over again.
IF...THEN
Your Turn
The
...
loop
FOR
NEXT
EndValue
can be adjusted for more or less turn, and the
adjusted to back up less for navigation in tighter spaces.
√
Experiment with the
routines in RoamingWithWhiskers.bs2.
You can also modify your
previous activity broadcast what maneuver the Boe-Bot is in by adding
commands to control the LED circuits. Here is an example.
IF (IN5
= 0) AND (IN7 = 0) THEN
HIGH 10
HIGH 1
GOSUB Back_Up
GOSUB Turn_Left
GOSUB Turn_Left
ELSEIF (IN5
HIGH 10
GOSUB Back_Up
Chapter 5: Tactile Navigation with Whiskers · Page 181
, and
subroutines should look fairly familiar, but
Back_Up
DO...LOOP
, which sends the program back up to
LOOP
arguments in the
Back_Up
...
loop
FOR
NEXT
EndValue
statements to make the LED indicators from the
IF...THEN
= 0) THEN
, each time the program returns from a
. What happens
DO
and
Back_Right
Back_Left
routine can have its
arguments in the navigation
routines
EndValue
and
HIGH
LOW
Need help?
Do you have a question about the Boe-Bot and is the answer not in the manual?
Questions and answers