27404 Parallax Inc, 27404 Datasheet - Page 156

COMPETITION RING FOR SUMOBOT

27404

Manufacturer Part Number
27404
Description
COMPETITION RING FOR SUMOBOT
Manufacturer
Parallax Inc
Datasheet

Specifications of 27404

Accessory Type
Hobby and Education
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Contains lead / RoHS non-compliant
For Use With/related Products
SumoBot®
Lead Free Status / RoHS Status
Lead free / RoHS Compliant, Contains lead / RoHS non-compliant
Example Program: ServoControlWithLookup.bs2
' -----[ Title ]--------------------------------------------------------------
' Applied Robotics with the SumoBot - ServoControlWithLookup.bs2
' {$STAMP BS2}
' {$PBASIC 2.5}
' -----[ I/O Definitions ]---------------------------------------------------
ServoLeft
ServoRight
' -----[ Constants ]----------------------------------------------------------
' SumoBot maneuver constants
Forward
Backward
RotateLeft
RotateRight
' Servo pulse width rotation constants
FS_CCW
FS_CW
Enter and save ServoControlWithLookup.bs2
Move the 3-position switch on the SumoBot circuit board to position 1.
Download the program to the SumoBot.
Hold down the Reset button on the SumoBot circuit board, then move the 3-
position switch from 1 to 2.
Place the SumoBot on the practice ring, let go of the Reset button, and watch it
navigate. It should move forward around 10 inches (25 cm), then rotate left
almost 90°, then rotate right almost 180°, then rotate left almost 90° to return to
the direction it was first facing. It should then continue forward and repeat the
“look left, look right” jog after another 10 inches.
The usefulness of the Reset subroutine. It sure was easier to just tap that Reset button to
make the SumoBot stop and wait wasn’t it? All you have to do is copy and paste a few
sections from TestResetButton.bs2 from Chapter 2, Activity #3 into this example program,
and you'll have that functionality again.
Calibration: Your servos may perform differently, so you many need to adjust the
FOR...NEXT loops' EndValue arguments to get your SumoBot to perform the search
pattern the way it was just described.
PIN
PIN
CON
CON
CON
CON
CON
CON
13
12
0
1
2
3
850
650
' Target = BASIC Stamp 2
' Language = PBASIC 2.5
' Left servo connected to P13
' Right servo connected to P12
' Forward
' Backward
' Rotate in place turning left
' Rotate in place turning right
' Full speed counterclockwise
' Full speed clockwise

Related parts for 27404