28125 Parallax Inc, 28125 Datasheet - Page 247

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
"FlashlightControlledBoeBot.bs2" and "RoamingTowardTheLight.bs2". A
sample solution is shown below.
' -----[ Title ]-------------------------------------------------------
' Robotics with the Boe-Bot - AvoidBlackSpots.bs2
' Boe-Bot avoids black pieces of paper.
' {$STAMP BS2}
' {$PBASIC 2.5}
' -----[ Constants ]---------------------------------------------------
LeftWhite
RightWhite
LeftBlack
RightBlack
LeftAvg
RightAvg
' -----[ Variables ]---------------------------------------------------
timeLeft
reading
timeRight
reading
' -----[ Initialization ]----------------------------------------------
FREQOUT 4, 2000, 3000
' -----[ Main Routine ]------------------------------------------------
DO
LOOP
' -----[ Subroutines --------------------------------------------------
Test_Photoresistors:
Measurement.
measurement.
RETURN
Navigate:
GOSUB Test_Photoresistors
GOSUB Navigate
HIGH 6
PAUSE 3
RCTIME 6,1,timeLeft
HIGH 3
PAUSE 3
RCTIME 3,1,timeRight
CON
CON
CON
CON
CON
CON
VAR
VAR
16
33
26
45
LeftWhite + LeftBlack / 2
RightWhite + RightBlack / 2
Word
Word
' Stamp directive
' PBASIC directive.
' Left photoresistor
' Right photoresistor
' Left RC time
' Right RC time

Related parts for 28125