Parallax Boe-Bot Assembly page 58

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

Advertisement

Page 48 · SumoBot – Mini Sumo Robotics
NEXT
lastIr = %00
GOTO Lunge
Spin_Right:
FOR pulses = 1 TO 20
PULSOUT LMotor, LFwdFast
PULSOUT RMotor, RRevFast
PAUSE 20
NEXT
lastIr = %00
GOTO Lunge
About_Face:
FOR pulses = 1 TO 10
PULSOUT LMotor, LRevFast
PULSOUT RMotor, RRevFast
PAUSE 20
NEXT
FOR pulses = 1 TO 30
PULSOUT LMotor, LFwdFast
PULSOUT RMotor, RRevFast
PAUSE 20
NEXT
lastIr = %00
GOTO Lunge
' --[ IR Processing ]--
Search_For_Opponent:
GOSUB Read_IR_Sensors
' If opponent is not in view, scan last known direction.
' opponent if seen by one "eye" -- if both, lunge forward
BRANCH irBits, [Scan, Follow_Right, Follow_Left, Lunge]
Scan:
BRANCH lastIR, [Move_Fwd, Scan_Right, Scan_Left]
Move_Fwd:
GOSUB Creep_Forward
GOTO Main
Scan_Right:
FOR pulses = 1 TO 5
PULSOUT LMotor, LFwdSlow
PULSOUT RMotor, RRevSlow
PAUSE 20
NEXT
GOSUB Creep_Forward
' clear scan direction
' left sensor was active
' both sensors on Shikiri
' back up from edge
' turn around
Turn toward
' spin right, slow
' keep moving

Advertisement

Table of Contents
loading

This manual is also suitable for:

QuadcrawlerToddlerSumobotHexcrawler

Table of Contents