Chapter 5: Tactile Navigation with Whiskers
· Page 189
Exercises
1.
Write a
DEBUG
command for TestWhiskers.bs2 that updates each whisker state
on a new line. Adjust the
PAUSE
command so that it is 250 instead of 50.
2.
Using RoamingWithWhiskers.bs2 as a reference, write a
Turn_Away
subroutine
that calls the
Back_Up
subroutine once and the
Turn_Left
subroutine twice.
Write down the modifications you will have to make to the Main Routine section
of RoamingWithWhiskers.bs2.
Projects
1.
Modify RoamingWithWhiskers.bs2 so that the Boe-Bot makes a 4 kHz beep that
lasts 100 ms before executing the evasive maneuver. Make it beep twice if both
whisker contacts are detected during the same sample.
2.
Modify RoamingWithWhiskers.bs2 so that the Boe-Bot roams in a 1 yard (or
meter) diameter circle. When you touch one whisker, it will cause the Boe-Bot
to travel in a tighter circle (smaller diameter). When you touch the other
whisker, it will cause the Boe-Bot to navigate in a wider diameter circle.