Download Print this page

Parallax Continuous Rotation Servo Manual page 6

Advertisement

Voltage and RPM: Maximum RPM will vary with input voltage; 50 RP
regulated Vdd as the sup ply source wi ll reduce fluct uations in RPM for a given pulse width that might
otherwise occur with unregulated battery supplies.
®
BASIC Stamp
Programming Examples
PBASIC has a PULSO UT command that sets the I/O
Duration
. Since the servo needs this pulse refreshed every 20 ms for continuous operation, the PULSOUT
command is put in a coun ted FOR...NEXT loop to su stain continuous operation for the speci fied number
of cycles.
Pin
Duration
PULSOUT
,
Different BASIC Stamp m odules use different units for the P ULSOUT command's
When adapting BS2 code to another BASIC Stamp model, you may need to make adjustments. The table
below lists the PULSOUT ranges for each BASIC Stamp microcontroller. See the BASIC Stamp Manual or
BASIC Stamp Editor Help for more information.
BASIC Stamp Model
BS1
BS2, BS2e, BS2pe
BS2sx, BS2p, BS2px
The example shown below for a BASIC Stamp 2 causes a servo connected to BASIC Stamp 1/0 pin 12 to
first rotate full-speed counterclockwise for about 3 seconds, hold still f or about 3 seconds, and then
rotate counterclockwise for about 3 seconds.
' RotateParallaxCrServo.bs2
' {$STAMP BS2}
' {$PBASIC 2.5}
counter VAR Word
servoPin PIN 12
FOR counter = 1 TO 100
PULSOUT servoPin, 850
PAUSE 20
NEXT
Copyright © Parallax Inc.
1.3 ms
(Full speed clockwise)
130
650
1625
' change I/O pin for servo signal here
' Rotate counterclockwise for ~3 seconds
Parallax Continuous Rotation Servo (#900-00008)
Pin
to an output and sends a pulse of the specified
1.5 ms
(Center, no rotation)
(Full speed counterclockwise)
150
750
1875
M @ 5 V is typical.
Duration
argument.
1.7 ms
170
850
2125
v2.2 10/24/2011 Page 6 of 8
Using

Advertisement

loading

This manual is also suitable for:

900-00008Rob-16048