Parallax Boe-Bot Assembly page 28

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

Advertisement

Page 18 · SumoBot – Mini Sumo Robotics
FOR pulses = 1 TO 55
PULSOUT LMotor, LFwdFast
PULSOUT RMotor, RRevFast
PAUSE 20
NEXT
Hold_Position:
DO
PULSOUT LMotor, LStop
PULSOUT RMotor, RStop
PAUSE 20
LOOP
END
As soon as the program is downloaded, remove the programming cable from the
SumoBot. This program runs through key motion tests, and then stops the SumoBot.
When the SumoBot stops moving after its final spin, move the power switch to position 0
(off). If it doesn't move at all, you may have set the power switch to position 1. You
don't have to download the program again if this happened; simply move the power
switch to position 2 and then press the Reset button to restart the program.
HOW IT WORKS
This program code starts – as well-coded programs do – by defining connection and
value constants used in the program. This methodology creates programs that are easier
to read, maintain, and debug. In the case of the SumoBot, the motor connections are on
pins 13 (left) and 12 (right). For robot Sumo, we don't need infinite speed control;
simply stop, slow and fast (these are relative terms, and will vary from servo type to
servo type). Speed constants for each motor are defined and can be tuned for motor
variances and when changing motor types.
The initialization section (labeled Reset as this is the first code that runs after the
SumoBot is reset) ensures that the motor control outputs are setup to provide the correct
pulse polarity to the servos, and then introduces a two-second delay to allow the
programming cable to be removed from the SumoBot.
SumoBot while doing any movement testing.
' spin turn - clockwise
It's best to disconnect the

Advertisement

Table of Contents
loading

This manual is also suitable for:

QuadcrawlerToddlerSumobotHexcrawler

Table of Contents