Download Print this page

Parallax 900-00005 Manual page 3

Standard servo kickstart

Advertisement

Program KickStarts
Each of the example programs turns the servo counter clockwise, then clockwise, and finally to
the center position. This movement is repeated indefinitely.
Important! Servo motors draw only minimal current when they're not attached to a mechanical
load, such as the leg of a robot. The example connection diagrams shown here provide only
modest current to the servo, so they are not intended to move heavy loads. They're useful for
demonstration only. To operate bigger loads the servo motor should be connected to its own 4.8
V to 6 V battery supply. See the links below for information on how to use separate power to
operate one or more R/C servo motors.
BASIC Stamp 2 HomeWork Board
'{$STAMP BS2}
'{$PBASIC 2.5}
counter VAR Word
Main:
FOR counter = 1 TO 100 ' Loop for 2 seconds
PULSOUT 0, 1000
PAUSE 20
NEXT
FOR counter = 1 TO 100 ' Loop for 2 seconds
PULSOUT 0, 500
PAUSE 20
NEXT
FOR counter = 1 TO 100 ' Loop for 2 seconds
PULSOUT 0, 750
PAUSE 20
NEXT
GOTO Main
Copyright © Parallax Inc.
' Servo counterclockwise
' Servo clockwise
' Servo center
Page 3 of 5

Advertisement

loading