28125 Parallax Inc, 28125 Datasheet - Page 103

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. First, calculate the number of loops needed to get the servos to run for three
LOOP
seconds, for each combination of rotation. As given on page 79, the code
overhead is 1.6 ms.
Four combinations (1,2,3,4).
Each combination: Determine
1. Both counterclockwise: 12, 850 and 13, 850
2. Both clockwise:
3. 12 CW and 13 CCW:
4. 12 CCW and 13 CW:
Each combination: Calculate how long it will take for one loop:
1. one loop = 1.7 + 1.7 + 20 ms + 1.6 = 25.0 ms = 0.025 s
2. one loop = 1.3 + 1.3 + 20 ms + 1.6 = 24.2 ms = 0.0242 s
3. one loop = 1.7 + 1.3 + 20 ms + 1.6 = 24.6 ms = 0.0246 s
4. one loop = 1.3 + 1.7 + 20 ms + 1.6 = 24.6 ms = 0.0246 s
Each combination: Calculate number of pulses needed for 3 s of running:
1. number of pulses = 3 s / 0.025 s = 120
2. number of pulses = 3 s / 0.0242 s = 123.9 = 124
3. number of pulses = 3 s / 0.0246 s = 121.9 = 122
4. number of pulses = 3 s / 0.0246 s = 121.9 = 122
Now write four
EndValue argument.
combination of rotation.
' Robotics with the Boe-Bot - Ch02Prj02_4RotationCombinations.bs2
' Move servos through 4 clockwise/counterclockwise rotation '
combinations.
'{$STAMP BS2}
'{$PBASIC 2.5}
PULSOUT 12, 650
PULSOUT 14, 650
PAUSE 20
FOR…NEXT
12, 650 and 13, 650
Include the correct
loops, using the number of pulses calculated for the
12, 850 and 13, 650
12, 650 and 13, 850
PULSOUT Duration
PULSOUT
arguments:
' P12 servo clockwise
' P14 LED lights dimly
arguments for the

Related parts for 28125