28125 Parallax Inc, 28125 Datasheet - Page 135

TEXT ROBOTICS

28125

Manufacturer Part Number
28125
Description
TEXT ROBOTICS
Manufacturer
Parallax Inc
Datasheet

Specifications of 28125

Title
Robotics with the Boe-Bot
Product
Microcontroller Accessories
Lead Free Status / RoHS Status
Not applicable / Not applicable
P2. To solve this problem, TestServoSpeed.bs2 must be expanded to receive three
FREQOUT 4, 2000, 3000
FOR counter = 1 TO 122
NEXT
FOR counter = 1 TO 40
NEXT
FOR counter = 1 TO 122
NEXT
FREQOUT 4, 500, 3500
END
pieces of data: left servo pulsewidth, right servo pulsewidth, and number of
pulses. Then, a
added to actually move the servo motors. Furthermore, all variables must be
declared in the beginning of the program. An example solution is shown below.
' Robotics with the Boe-Bot - Ch03Prj02_DebuginMotion.bs2
' Enter servo pulsewidth & duration for both wheels via Debug Terminal.
'{$STAMP BS2}
'{$PBASIC 2.5}
ltPulseWidth
rtPulseWidth
pulseCount
counter
DO
PULSOUT 12, 650
PAUSE 20
PULSOUT 12, 750
PAUSE 20
PULSOUT 12, 850
PAUSE 20
DEBUG "Enter left servo pulse width: "
DEBUGIN DEC ltPulseWidth
DEBUG "Enter right servo pulse width: "
DEBUGIN DEC rtPulseWidth
DEBUG "Enter number of pulses:
DEBUGIN DEC pulseCount
FOR counter = 1 TO pulseCount
FOR…NEXT
VAR
VAR
VAR
VAR
Word
Word
Byte
Word
loop with two servo
' Signal start of program.
' Clockwise just under 3 seconds.
' Stop one second.
' Counterclockwise three seconds.
' Signal end of program
' Left servo pulse width
' Right servo pulse width
' Number of pulses to servo
' Loop counter
' Send specific number of pulses
"
PULSOUT
' Enter values in Debug
' Terminal
commands must be

Related parts for 28125