Parallax Boe-Bot Student Manual page 204

Hide thumbs Also See for Boe-Bot:
Table of Contents

Advertisement

Page 190 · Robotics with the Boe-Bot
Solutions
Q1. A tactile switch.
Q2. Zero (0) volts, resulting in Binary zero (0) at the input register.
IN8 = 0 when whisker is pressed. IN8 = 1 when whisker is not pressed.
Q3. IN7 = 1 means the right whisker is not pressed.
IN7 = 0 means the right whisker is pressed.
IN5 = 1 means the left whisker is not pressed.
IN5 = 0 means the left whisker is pressed.
Q4. The
command performs the actual jump. The
GOSUB
to decide which subroutine to jump to. That decision is based on conditions,
which are logical statements that evaluate to true or false.
Q5. The program can check for one condition, and if that condition is true, it can
check for another condition within the first condition.
E1. The key to solving this problem is to use a second
place the right whisker state in the proper place on the screen. To line up with
the headings, the text should start on column 9 of row 3.
' Robotics with the Boe-Bot - TestWhiskers_UpdateEaOnNewLine.bs2
' Update each whisker state on a new line.
' {$STAMP BS2}
' {$PBASIC 2.5}
DEBUG "WHISKER STATES", CR,
"Left
"------
DO
DEBUG CRSRXY, 0, 3, "P5 = ", BIN1 IN5
DEBUG CRSRXY, 9, 3, "P7 = ", BIN1 IN7
PAUSE 250
LOOP
E2.
_
:
Turn
Away
GOSUB Back_Up
GOSUB Turn_Left
GOSUB Turn_Left
RETURN
Right", CR,
------"
...
command is used
IF
THEN
command that will
CRSRXY
' Stamp directive.
' PBASIC directive.
' Print in Column 0,Row 3
' Print in Column 9,Row 3
' Change from 50 to 250

Advertisement

Table of Contents
loading

Table of Contents