Trying to understand servo control
LisaQ
Posts: 33
I want to be sure I understand this correctly:
Does PULSOUT 14, 1000 mean "send a high out on pin14 for 2mS"?
and if it does, would HIGH 14
·························· ··PAUSE 2
do the same thing?
LisaQ
Does PULSOUT 14, 1000 mean "send a high out on pin14 for 2mS"?
and if it does, would HIGH 14
·························· ··PAUSE 2
do the same thing?
LisaQ
Comments
If the initial pin state is low, that means "send a high out on pin 14 for 2ms".
Yes, you could do "HIGH 14 : PAUSE 2"
Read the description of the statement in the "BASIC Stamp Syntax and Reference Manual". It's pretty explicit.
I guess I'm confused about the definition of pulse- I thought it was a transition of hi to low or low to high. If I understand what you're saying there are actually many pulses (toggle Pin 14 for·2ms)·within that 2 mS.
Now I have another question, I'm looking at the example in Syntax manual on p349.
Pulsout 0, 2500··· 'Flash LED for 25mS
Wouldn't 2500 * 2uS= 5mS?
LisaQ
Read the documentation ... Toggle means to invert ... If the signal is high, make it low. If the signal is low, make it high.
There's one pulse produced by PULSOUT, but its polarity depends on the initial state of the I/O pin.
The example in the Reference Manual is for the BS1 where the time units for PULSOUT are 10us, not 2us.