27404 Parallax Inc, 27404 Datasheet - Page 155

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
The servo control subroutine will send pulse values to the servos. Constants for full
speed counterclockwise (
(
Here is the
by a constant declaration (
Pulse_Servos
the lookup table, and copies it to the
FS_CCW
servo, which is connected to P13. It's equivalent to
LOOKUP
variable. So
makes the right servo turn full speed clockwise.
If
to the
for the
FS_CW
RotateRight
commands send 850 to the servos.
NO_ROT)
maneuver
temp
is copied to
FS_CCW
FS_CW
NO_ROT
' -----[ Subroutine - Pulse_Servos ]-----------------------------------
Pulse_Servos:
PULSOUT ServoRight, temp
(850) to
and
will make the subroutine easier to write.
' Pulse to left servo
LOOKUP maneuver, [FS_CCW, FS_CW, FS_CW, FS_CCW], temp
PULSOUT ServoLeft, temp
' Pulse to right servo
LOOKUP maneuver, [FS_CW, FS_CCW, FS_CW, FS_CCW], temp
PULSOUT ServoRight, temp
' Pause between pulses (remove when using IR object detectors + QTIs)
PAUSE 20
RETURN
Pulse_Servos
variable for the
is set equal to the constant
PULSOUT
PULSOUT ServoRight, temp
(3),
subroutine is called, the
temp
FS_CCW
temp
. Then
commands in the subroutine place
CON
CON
CON
Forward CON 0
FS_CCW
subroutine. Remember that
PULSOUT ServoLeft, temp
for both
gets copied to both
PULSOUT ServoLeft, temp
850
650
750
), full speed clockwise (
temp
PULSOUT
Backward
LOOKUP
command. If
). If maneuver is set to
variable. The first lookup command copies
is equivalent to
commands.
command takes the zeroth element in
, the
' Full speed counterclockwise
' Full speed clockwise
' No rotation
temp
PULSOUT 13, 850
LOOKUP
Forward
maneuver
command, and
variables, and the
FS_CCW
sends that pulse to the left
PULSOUT 12, 650
FS_CW
Finally, if
command copies
is a constant, set to 0
Forward
is
), and no rotation
(650) into the
RotateLeft
FS_CCW
. The second
maneuver
before the
PULSOUT
to
, which
FS_CW
temp
temp
(2),
is

Related parts for 27404