Parallax Boe-Bot Assembly page 59

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

Advertisement

GOTO Main
Scan_Left:
FOR pulses = 1 TO 5
PULSOUT LMotor, LRevSlow
PULSOUT RMotor, RFwdSlow
PAUSE 20
NEXT
GOSUB Creep_Forward
GOTO Main
Follow_Right:
PULSOUT LMotor, LFwdFast
PULSOUT RMotor, RRevSlow
lastIR = irBits
GOTO Main
Follow_Left:
PULSOUT LMotor, LRevSlow
PULSOUT RMotor, RFwdFast
lastIR = irBits
GOTO Main
Lunge:
FOR pulses = 1 TO 25
PULSOUT LMotor, LFwdFast
PULSOUT RMotor, RFwdFast
GOSUB Read_Line_Sensors
IF (lineBits = %11) THEN Match_Over
NEXT
GOTO Main
' If SumoBot can see the opponent with both "eyes" and both QTIs are
' detecting the border, we must have pushed the opponent out.
Match_Over:
FOR pulses = 1 TO 10
PULSOUT LMotor, LStop
PULSOUT RMotor, RStop
PAUSE 20
NEXT
INPUT LMotor
INPUT RMotor
FOR temp = 1 TO 10
HIGH StartLED
FREQOUT Speaker, 100, 2500, 3000
INPUT StartLED
PAUSE 100
NEXT
Chapter 5: Basic Competition Code · Page 49
' spin left, slow
' spin right, fast
' save last direction found
' spin left, fast
' locked on -- go get him!
' in sight, we're on the line
' stop motors
' make some noise
' beep
' blink LED

Advertisement

Table of Contents
loading

This manual is also suitable for:

QuadcrawlerToddlerSumobotHexcrawler

Table of Contents