Conditional Compilation For Pulsout
NWUpgrades
Posts: 292
Is it possible to create a Conditional Compilation for the Pulsout function? This would surely simplify running the BS2 code for the BoeBot, etc on a BS2sx chip. Just a thoght...
Comments
You could use the conditional compilation directives right around the PULSOUT statement(s), but you'd end up with a very very difficult to read, but otherwise correct and efficient version.
myPin PIN 13
then you'd add either
adjFactor CON 2 ' PULSOUT unit is 2us
or
adjFactor CON 5 ' PULSOUT unit is 0.8us
to the various groups of conditional declarations.
If you want to produce a 1.5ms pulse, you'd put
PULSOUT myPin, (1500 * adjFactor) >> 2