28125 Parallax Inc, 28125 Datasheet - Page 265

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
FREQOUT 4, 2000, 3000
' -----[ Main Routine ]-------------------------------------------------------
DO
LOOP
' -----[ Subroutines ]--------------------------------------------------------
Forward_Pulse:
Turn_Left:
Turn_Right:
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,850
PULSOUT 12,650
PAUSE 20
RETURN
FOR pulseCount = 0 TO 20
NEXT
RETURN
FOR pulseCount = 0 TO 20
NEXT
RETURN
GOSUB Back_Up
GOSUB Turn_Left
GOSUB Turn_Left
GOSUB Back_Up
GOSUB Turn_Right
GOSUB Back_Up
GOSUB Turn_Left
GOSUB Forward_Pulse
PULSOUT 13, 650
PULSOUT 12, 650
PAUSE 20
PULSOUT 13, 850
PULSOUT 12, 850
PAUSE 20
' Signal program start/reset.
' Store IR detection values in
' bit variables.
' Both IR pairs detect obstacle
' Back up & U-turn (left twice)
' Left IR pair detects
' Back up & turn right
' Right IR pair detects
' Back up & turn left
' Both IR pairs 1, no detects
' Apply a forward pulse
' and check again
' Send a single forward pulse.
' Left turn, about 90-degrees.
' Right turn, about 90-degrees.

Related parts for 28125