28125 Parallax Inc, 28125 Datasheet - Page 313

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
' That's it.
' to follow the intersection.
Check_For_Intersection:
' Keep track of no. of pulses vs the forward pulses.
' than 30 forward pulses per total of 60 pulses, robot is likely stuck
' at an intersection.
Make_Noise:
' Makes an increasing tone, proportional to number of forward pulses
Update_LEDs:
' Use LEDs to indicate whether detectors are seeing black or white.
' White = Off, Black = On.
Stop_Quickly:
' This stops the wheels so the Boe-Bot does not "coast" forward.
NEXT
ENDIF
RETURN
isStuck = 0
numPulses = numPulses + 1
SELECT numPulses
ENDSELECT
RETURN
FOR counter = 1 TO fwdPulses STEP 3
NEXT
RETURN
IF (distanceLeft >= 4)
IF (distanceRight >= 4) THEN HIGH RightLED ELSE LOW RightLED
RETURN
PULSOUT 13, 750
PAUSE 20
CASE < 60
CASE = 60
CASE > 60
FREQOUT 4, 100, 3800 + (counter * 10)
IF (pulseLeft > CenterPulse) THEN
ENDIF
IF (fwdPulses < 30) THEN
ENDIF
numPulses = 0
fwdPulses = 0
fwdPulses = fwdPulses + 1
isStuck = 1
At this point the Boe-Bot should have turned 90 degrees
THEN HIGH LeftLED
Black is a distance reading > or = 4 .
Continue following the black line.
' Initialze Boolean variable
' Count total pulses sent
' Count foward pulses
' (forward is any pulse > 750)
' If we have sent 60 pulses
' how many were forward?
' If < 30, robot is stuck
' Reset counters back to zero
' (Could reset in =60 case but
' it spoils cool Make_Noise)
ELSE LOW LeftLED
If there are less

Related parts for 28125