28125 Parallax Inc, 28125 Datasheet - Page 340

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
' Robotics with the Boe-Bot - BalancePhotoresistors.bs2
' Test adjustments to Boe-Bot photoresistor circuits.
' {$STAMP BS2}
' {$PBASIC 2.5}
timeLeft
timeRight
DEBUG "PHOTORESISTOR VALUES", CR,
DO
HIGH 6
PAUSE 3
RCTIME 6,1,timeLeft
HIGH 3
PAUSE 3
RCTIME 3,1,timeRight
DEBUG CRSRXY, 0, 3,
"timeLeft
"--------
Calculate the values of m you will use with the */ operator by multiplying m by
256.
Substitute
BalancePhtoresistors.bs2:
Enter, save, and run your adjusted version of BalancePhotoresistors.bs2.
Expose both photoresistors to the same light level.
Verify that the “after” values are similar and corrected for differences in the
“before” values.
Choose a different light level and again, expose both photoresistors to it.
Check the “after” values again for similarity.
When you have determined your values for m and b, you can modify
RoamingTowardTheLight.bs2 by uncommenting the equation between
Test_Photoresistors
will replace
DEC5 timeLeft,
"
timeLeft = (timeLeft */ 351) + 7
VAR
VAR
",
timeRight", CR,
---------"
351
your
Word
Word
and your b value will replace
value
and
of
GOSUB Average_And_Difference
m and
' Stamp directive.
' PBASIC directive.
' Variable declarations.
' Initialization.
' Main routine.
' Left RC time measurement.
' Right RC time measurement.
' Display measurements.
b
7
in
.
this
line of
. Your m value
code
GOSUB
from

Related parts for 28125