28125 Parallax Inc, 28125 Datasheet - Page 128

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
LOOP
How TestServoSpeed.bs2 Works
Three variables are declared,
DEBUGIN
used in a second
The
The remainder of the program is nested within a
over again. The Debug Terminal’s operator (that's you) is asked to enter a pulse width.
The
To make the measurement more accurate, two
making one
the sum of the two
two
matter the
same amount of time to execute. This will make the
the Your Turn section more accurate.
This next command takes the pulse width you entered, and calculates a pulse width that
will make 1500 when the two are added together. If you enter a pulse width of 650,
pulseWidthComp
FOR counter = 1 TO 244
NEXT
PULSOUT 12, pulseWidth
PULSOUT 13, pulseWidthComp
PAUSE 20
FREQOUT
DEBUGIN
PULSOUT
counter
pulseWidth
pulseWidthComp VAR
FREQOUT 4,2000,3000
and
DEBUG "Enter pulse width: "
DEBUGIN DEC pulseWidth
Duration
PULSOUT
command is used to signal that the program has started.
command stores this value in the
commands combined take the same amount of time. The result is that no
PULSOUT
PULSOUT
will be 850. If you enter a pulse width of 850,
PULSOUT Duration
of your
command the same amount below 750 as the other is above 750,
commands, and
command.
VAR
VAR
PULSOUT
counter
Word
Word
Word
arguments is always 1500. That ensures that the
command, the
pulseWidthComp
for the
pulseWidth
PULSOUT
FOR…NEXT
DO…LOOP
RPM
FOR…NEXT
commands have to be sent. By
measurements you will take in
, so it will execute over and
which stores a value that is
variable.
loop,
loop will still take the
pulseWidthComp
pulseWidth
for the
will

Related parts for 28125