27403 Parallax Inc, 27403 Datasheet - Page 165

GUIDE APP ROBOTCS W/SUMOBOT V1.0

27403

Manufacturer Part Number
27403
Description
GUIDE APP ROBOTCS W/SUMOBOT V1.0
Manufacturer
Parallax Inc
Datasheet

Specifications of 27403

Accessory Type
Manual
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
SumoBot®
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
temp
counter
maneuver
sensors
irLS
irLF
irRF
irRS
' -----[ Main Routine ]-------------------------------------------------------
DO
LOOP
' -----[ Subroutine - Servos_And_Sensors ]------------------------------------
Servos_And_Sensors:
IF irLF = 1 AND irRF = 1 THEN
ELSEIF irLF = 1 THEN
ELSEIF irRF = 1 THEN
ELSE
ENDIF
GOSUB Pulse_Servos
' Call sensor subroutine(s).
sensors = 0
GOSUB Read_Object_Detectors
maneuver = Forward
GOSUB Servos_And_Sensors
counter = 0
DO UNTIL (irLF = 1 AND irRF = 1) OR counter > 15
LOOP
counter = 0
DO UNTIL (irLF = 1 AND irRF = 1) OR counter > 15
LOOP
GOSUB Read_Object_Detectors
maneuver = PivotLeft
GOSUB Servos_And_Sensors
counter = counter + 1
maneuver = PivotRight
GOSUB Servos_And_Sensors
counter = counter + 1
VAR
VAR
VAR
VAR
VAR
VAR
VAR
VAR
Word
Byte
Nib
Byte
sensors.BIT3
sensors.BIT2
sensors.BIT1
sensors.BIT0
' Temporary variable
' Loop counting variable.
' SumoBot travel maneuver
' Sensor flags byte
' State of Left Side IR
' State of Left Front IR
' State of Right Front IR
' State of Right Side IR
' Both?
' State = Lunge forward
' Just left?
' State = track front left object
' Pivot left 15
' Just right?
' State=track front right object
' Pivot right 15
' No objects detected?
' State = search pattern
' Call Pulse_Servos subroutine
' Clear previous sensor values
' Call Read_Object_Detectors

Related parts for 27403