
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: ' spin right, slow
DEBUG HOME, "Scan Right", CLREOL
PULSOUT LMotor, LFwdSlow
PULSOUT RMotor, RRevSlow
PAUSE 20
GOTO Main
Scan_Left: ' spin left, slow
DEBUG HOME, "Scan Left", CLREOL
PULSOUT LMotor, LRevSlow
PULSOUT RMotor, RFwdSlow
PAUSE 20
GOTO Main
Follow_Right: ' spin right, fast
DEBUG HOME, "Follow Right", CLREOL
PULSOUT LMotor, LFwdFast
PULSOUT RMotor, RRevFast
PAUSE 20
lastIr = irBits ' save last direction found
GOTO Main
Follow_Left: ' spin left, fast
DEBUG HOME, "Follow Left", CLREOL
PULSOUT LMotor, LRevFast
PULSOUT RMotor, RFwdFast
PAUSE 20
lastIr = irBits
GOTO Main
Hold: ' on target
DEBUG HOME, "On Target", CLREOL
FOR pulses = 1 TO 3
PULSOUT LMotor, LStop
PULSOUT RMotor, RStop
PAUSE 20
NEXT
lastIr = %00
GOTO Main
Summary of Contents for Boe-Bot
Page 1: ...SumoBot Mini Sumo Robotics Assembly Documentation and Programming VERSION 2 1...
Page 4: ......
Page 9: ...Preface Page ix...
Page 10: ......
Page 20: ......
Page 32: ......
Page 54: ......
Page 74: ......
Page 76: ......
Page 77: ...Appendix D SumoBot PCB Schematic Page 67 Appendix D SumoBot PCB Schematic...