Timing Quirk
lockadoc
Posts: 115
I made a small method to light some leds for an amount of time after a button push than they turn off.
the quirk is that when I change the variableto a larger number the on time goes down instead of up.
I can come up with the number I need for the two different delays I want.But would like to know the why of quirk
Bill S
the quirk is that when I change the variableto a larger number the on time goes down instead of up.
I can come up with the number I need for the two different delays I want.But would like to know the why of quirk
Bill S
spin
783B
Comments
First, create a constant for one millisecond:
This assumes that you have an 80MHz system (typical). Next create a simple public method:
BAM! You're done, and no more guessing or calculating values for waitcnt. If you want to wait 0.1 seconds, you use pause(100). Want to wait 2.5 seconds, use pause(2_500). Honestly, it doesn't get much easier than that, and your programs will be much easier to follow.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon McPhalen
Hollywood, CA
Post Edited (JonnyMac) : 1/19/2010 1:54:33 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
My Prop Info&Apps: ·http://www.rayslogic.com/propeller/propeller.htm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon McPhalen
Hollywood, CA
Nice code snippet