28125 Parallax Inc, 28125 Datasheet - Page 267

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
irDetectRight
pulseLeft
pulseRight
FREQOUT 4, 2000, 3000
DO
LOOP
How FastIrRoaming.bs2 Works
This program takes a slightly different approach to applying pulses. Aside from the two
bits used to store the IR detector outputs, it uses two word variables to set the pulse
durations delivered by the
Inside the
each IR LED. Immediately after the 1 ms burst of IR is sent, a bit variable stores the
output state of the IR detector. This is necessary, because if you wait any longer than a
FREQOUT 8, 1, 38500
irDetectLeft = IN9
FREQOUT 2, 1, 38500
irDetectRight = IN0
IF (irDetectLeft = 0) AND (irDetectRight = 0) THEN
ELSEIF (irDetectLeft = 0) THEN
ELSEIF (irDetectRight = 0) THEN
ELSE
ENDIF
PULSOUT 13,pulseLeft
PULSOUT 12,pulseRight
PAUSE 15
pulseLeft = 650
pulseRight = 850
pulseLeft = 850
pulseRight = 850
pulseLeft = 650
pulseRight = 650
pulseLeft = 850
pulseRight = 650
irDetectLeft
irDetectRight
pulseLeft
pulseRight
DO…LOOP
VAR
VAR
VAR
, the
FREQOUT
Bit
Word
Word
PULSOUT
VAR
VAR
VAR
VAR
commands are used to send a 38.5 kHz IR signal to
command.
Bit
Bit
Word
Word
' Signal program start/reset.
' Main Routine
' Check IR Detectors
' Decide how to navigate.
' Apply the pulse.
' Repeat main routine

Related parts for 28125