28125 Parallax Inc, 28125 Datasheet - Page 238

TEXT ROBOTICS

28125

Manufacturer Part Number
28125
Description
TEXT ROBOTICS
Manufacturer
Parallax Inc
Datasheet

Specifications of 28125

Title
Robotics with the Boe-Bot
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Not applicable / Not applicable
' -----[ Subroutine - Average_And_Difference ]--------------------------------
Average_And_Difference:
' -----[ Subroutine - Navigate ]----------------------------------------------
Navigate:
Your Turn – Adjusting the Sensitivity to Differences in Light
Right now, the
average
in light or divide it by a larger value if you want to make the Boe-Bot more sensitive to
differences in light level.
average = timeRight + timeLeft / 2
difference = average / 6
RETURN
' Shadow significantly stronger on left detector, turn right.
IF (timeLeft > timeRight + difference) THEN
' Shadow significantly stronger on right detector, turn left.
ELSEIF (timeRight > timeLeft + difference) THEN
' Shadows in same neighborhood of intensity on both detectors.
ELSE
ENDIF
PAUSE 10
RETURN
PULSOUT 13, 850
PULSOUT 12, 850
PULSOUT 13, 650
PULSOUT 12, 650
PULSOUT 13, 850
PULSOUT 12, 650
by a smaller value if you want to make the Boe-Bot less sensitive to differences
Why
subroutine has two
the
pulses, so the
and error experiments,
performance over the widest range of light levels.
RCTIME
PAUSE 10
difference
commands. Both these factors add to the amount of time between servo
PAUSE
instead of
PAUSE
in the
variable is the
PAUSE 10
commands adding up to 6 ms plus some extra time to execute
Navigate
PAUSE 20?
appeared to give the servos the most reliable
average
subroutine has to be reduced. After some trial
Because the
divided by 6. You can divide
Test_Photoresistors

Related parts for 28125