Can you pulsout more than one pin in the same command?
Robot Jay
Posts: 12
Is it possible to pulsout more than one pin with only 1 line of code?· I need·servos to act as simultaneous·as possible and I was curious if the BS can do this.· Thanks for your help.
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Use one pin (P2 in this case) as the PULSOUT pin, and two other pins (P0 and P1) as 'control' pins.
Use an OR chip (usually 4 OR gates in each package) and connect P0 and P2 to the inputs of one gate, and P1 and P2 to the inputs of the other gate.
The Servo inputs are connected to the OR gate outputs.
Now, as long at both P0 and P1 is high, no amount of pulsing on P2 will result in anything happening.
(The outputs stays high)
To control just one of the servos, pull either P0 or P1 low, then PULSOUT on P2.
To control BOTH servos, pull both P0 and P1 low, then PULSOUT on P2.
Want to use more servos simultaneously?
Thee's still two OR gates left in the IC...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Don't visit my new website...
Plus, you need to refresh the pulse every 20 mSec, and I believe it may take a few refreshes for the Servo to reach the desired position anyway. Bottom line, a BS2 with Servo's is as "simultaneous" as you're going to need.
Now, I understand you can use the PSC unit to control more servos. And you CAN get better simultaneaity in the output signals if you use an SX platform. But my argument above says, it won't make that much difference.