28125 Parallax Inc, 28125 Datasheet - Page 311

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
intersection is a 3-way or 4-way intersection, the Boe-Bot will arbitrarily turn in
the direction that black is first detected. A constant,
to tune the 90 degree turn. Some audible and visual indicators are included,
which aid in troubleshooting and understanding what the Boe-Bot is seeing and
deciding, as well as adding a bit of personality and fun.
' -----[ Title ]-------------------------------------------------------
' Robotics with the Boe-Bot - IntersectionsBoeBot.bs2
' Navigate 90 degree left/right, 3-way, and 4-way intersections.
' Based on StripeFollowingBoeBot.bs2
' {$STAMP BS2}
' {$PBASIC 2.5}
DEBUG "Program Running!"
' -----[ Constants ]---------------------------------------------------
Kpl
Kpr
SetPoint
CenterPulse
Turn90Degree
RightLED
LeftLED
' -----[ Variables ]---------------------------------------------------
freqSelect
irFrequency
irDetectLeft
irDetectRight
distanceLeft
distanceRight
pulseLeft
pulseRight
numPulses
fwdPulses
counter
isStuck
' -----[ Initialization ]----------------------------------------------
FREQOUT 4, 2000, 3000
' -----[ Main Routine ]------------------------------------------------
DO
GOSUB Get_Ir_Distances
CON
CON
CON
CON
CON
PIN
PIN
VAR
VAR
VAR
VAR
VAR
VAR
VAR
VAR
VAR
VAR
VAR
VAR
35
-35
3
750
30
1
10
Nib
Word
Bit
Bit
Nib
Nib
Word
Word
Byte
Byte
Byte
Bit
' Stamp directive.
' PBASIC directive.
' Left proportional constant
' Right proportional constant
' 0-1 is White, 4-5 is Black
' Pulses needed for 90 turn
' LED Indicators
' Sweep through 5 frequencies
' Freq sent to IR emitter
' Store results from detectors
' Calculate distance zones
' Servo pulseWidths
' Count total pulses
' Count forward pulses
' Boolean variable,is bot stuck?
' Read IR sensors
Turn90Degree
, is provided

Related parts for 28125