Parallax Boe-Bot Assembly page 42

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

Advertisement

Page 32 · SumoBot – Mini Sumo Robotics
GOTO Main
Spin_Right:
FOR pulses = 1 TO 20
PULSOUT LMotor, LFwdFast
PULSOUT RMotor, RRevFast
PAUSE 20
NEXT
GOTO Main
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
GOTO Main
END
' -----[ Subroutines ]-----------------------------------------------------
Read_Line_Sensors:
HIGH LLinePwr
HIGH RLinePwr
HIGH LLineIn
HIGH RLineIn
PAUSE 1
RCTIME LLineIn, 1, lLine
RCTIME RLineIn, 1, rLine
LOW LLinePwr
LOW RLinePwr
' convert readings to bits
LOOKDOWN lLine, >=[1000, 0], lbLeft
LOOKDOWN rLine, >=[1000, 0], lbRight
RETURN
HOW IT WORKS
This program incorporates a very handy technique created by Andy Lindsay that allows
the operator to use the SumoBot PCB's Reset button for Run/Don't Run control. This is
' back up from edge
' turn around
' activate sensors
' discharge caps
' read left sensor
' read right sensor
' deactivate sensors
' 0 = black, 1 = line

Advertisement

Table of Contents
loading

This manual is also suitable for:

QuadcrawlerToddlerSumobotHexcrawler

Table of Contents