28125 Parallax Inc, 28125 Datasheet - Page 97

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
' {$STAMP BS2}
' {$PBASIC 2.5}
DEBUG "Program Running!"
counter VAR Byte
FOR counter = 1 TO 100
NEXT
FOR counter = 1 TO 200
NEXT
END
Let’s say you want to run both servos, the P13 servo at a pulse width of 850 and the P12
servo at a pulse width of 650. Now, each time through the loop, it will take:
If you want to run the servos for a certain amount of time, you can calculate it like this:
Lets’ say we want to run the servos for 3 seconds. That’s
Now, you can use the value 122 in the
like this:
PULSOUT 13, 850
PAUSE 20
PULSOUT 12, 850
PAUSE 20
1.7ms
1.3 ms
20 ms
1.6 ms
---------
24.6 ms –
Number of pulses = Time s / 0.0246s = Time / 0.0246
Number of pulses = 3 / 0.0246 = 122
FOR counter = 1 TO 122
NEXT
PULSOUT 13, 850
PULSOUT 12, 650
PAUSE 20
Servo connected to P13
Servo connected to P12
Pause duration
Code overhead
Total
------------------------------
EndValue
of the
FOR…NEXT
loop, and it will look

Related parts for 28125