122-27400 Parallax Inc, 122-27400 Datasheet - Page 52

MANUAL FOR SUMOBOT

122-27400

Manufacturer Part Number
122-27400
Description
MANUAL FOR SUMOBOT
Manufacturer
Parallax Inc
Datasheet

Specifications of 122-27400

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
Page 42 · SumoBot – Mini Sumo Robotics
Main:
Scan:
Move_Fwd:
Scan_Right:
Scan_Left:
Follow_Right:
Follow_Left:
Hold:
GOSUB Read_IR_Sensors
BRANCH irBits, [Scan, Follow_Right, Follow_Left, Hold]
BRANCH lastIR, [Move_Fwd, Scan_Right, Scan_Left, Move_Fwd]
DEBUG HOME, "Forward", CLREOL
GOTO Main
DEBUG HOME, "Scan Right", CLREOL
PULSOUT LMotor, LFwdSlow
PULSOUT RMotor, RRevSlow
PAUSE 20
GOTO Main
DEBUG HOME, "Scan Left", CLREOL
PULSOUT LMotor, LRevSlow
PULSOUT RMotor, RFwdSlow
PAUSE 20
GOTO Main
DEBUG HOME, "Follow Right", CLREOL
PULSOUT LMotor, LFwdFast
PULSOUT RMotor, RRevFast
PAUSE 20
lastIr = irBits
GOTO Main
DEBUG HOME, "Follow Left", CLREOL
PULSOUT LMotor, LRevFast
PULSOUT RMotor, RFwdFast
PAUSE 20
lastIr = irBits
GOTO Main
DEBUG HOME, "On Target", CLREOL
FOR pulses = 1 TO 3
NEXT
lastIr = %00
GOTO Main
PULSOUT LMotor, LStop
PULSOUT RMotor, RStop
PAUSE 20
' spin right, slow
' spin left, slow
' spin right, fast
' save last direction found
' spin left, fast
' on target

Related parts for 122-27400