Parallax Boe-Bot Assembly page 52

Mini-sumo robotics assembly documentation and programming
Hide thumbs Also See for Boe-Bot:
Table of Contents

Advertisement

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

Advertisement

Table of Contents
loading

This manual is also suitable for:

QuadcrawlerToddlerSumobotHexcrawler

Table of Contents