Variable Pin # in PULSOUT
I feel like I am missing something obvious.· I want to put the Pulsout command into a subroutine and be able to supply it with a variable pin number.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
John J. Couture
San Diego Miramar College
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
John J. Couture
San Diego Miramar College
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Paul
Post Edited (Velocit
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
John J. Couture
San Diego Miramar College
Note that my version (above) does not make the pin an output; you should make any pin that will be pulsed an output and it the non-pulse state before using the routine.
Another great thing about SX/B is that you can mix assembly into BASIC, and use interrupts. I've attached reasonably-simple program that has an eight-channel virtual servo controller connected to RB.0 to RB.7. EFX-TEK customers do a lot of servo animations so this framework makes things easy on them; all they have to do is tell a servo where to be in the foreground (via the pos array) and the ISR takes care of the rest -- for up to eight servos.
Post Edited (JonnyMac) : 4/12/2008 9:41:46 PM GMT