pulsewidth var word
main:
pulsin port-whatever-pin-whatever, 1, pulsewidth '1 if you pulse is active high
pulsewidth = 2000 - pulsewidth
pulsout port-whatever-pin-whatever, pulsewidth
goto main
Of course, this assumes that your max pulse width is 2ms, usually they go a tad bit farther than 2ms (2.5ms is max endpoint on one of my Futaba's). And the 2000 will also depend on how fast your oscillator runs.
And this will (by default), run at the correct frequency, since the pulsin will only activate when you're servo gets a pulse. Then the program will output the 'inverted' pulse, then go back to the start and wait for the next pulse.
3 other questions:
What's a berk?
What is it to be berky?
What's a boffin, and how many of them does it take to screw in a light bulb?![]()





Bookmarks