measuring time elasped between button presses in milliseconds
duffling
Posts: 73
I have written a routine that does this already but im wondering if someone has a better more accurate routine
basically im working out Beats per minute with the user tapping the tempo with one button
my program enters a loop then calculates the difference between button press times to calculate the bpm
its ok .. but i need it to be more accurate ..im using the Button command to debounce the key input loop
this works well .. my way is not too elegent
i have not used the count command before .. is this a better way to do it ?
if someone can give me some tips this would be much app.
thanks!
·
basically im working out Beats per minute with the user tapping the tempo with one button
my program enters a loop then calculates the difference between button press times to calculate the bpm
its ok .. but i need it to be more accurate ..im using the Button command to debounce the key input loop
this works well .. my way is not too elegent
i have not used the count command before .. is this a better way to do it ?
if someone can give me some tips this would be much app.
thanks!
·
Comments
Your 'non-elegant' solution may be the best one the BS2 offers. There does exist a 'co-processor' which will give you an exact 50 millisecond square wave that you can use to measure other events.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
bugg
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
But I canna change the laws of physics, Captain!