I have Teensy 3.6's that I'm working with.
I have a project that needs to keep track of how long solenoids have been energized and if a pre-set time is exceeded shut them down. This is to avoid them burning up. The time on this is in the 10 - 60 millisecond range (some solenoids go longer than others).
The documentation on elapsedMillis says to avoid == in comparisons because the value can change by more than 1. How much more can it change?
It's looking like perhaps elaspedMicros would be better. Is there a significant impact to having dozens of these timers running at the same time (around 88 in total)? I'm assuming these variables are updated in an interrupt, and the more of them there are the longer that interrupt will take, and a microsecond counter is updated 1000 more often than a millisecond one, but perhaps it's so fast it wouldn't matter. I'm use to much slower processors
Thanks!
I have a project that needs to keep track of how long solenoids have been energized and if a pre-set time is exceeded shut them down. This is to avoid them burning up. The time on this is in the 10 - 60 millisecond range (some solenoids go longer than others).
The documentation on elapsedMillis says to avoid == in comparisons because the value can change by more than 1. How much more can it change?
It's looking like perhaps elaspedMicros would be better. Is there a significant impact to having dozens of these timers running at the same time (around 88 in total)? I'm assuming these variables are updated in an interrupt, and the more of them there are the longer that interrupt will take, and a microsecond counter is updated 1000 more often than a millisecond one, but perhaps it's so fast it wouldn't matter. I'm use to much slower processors
Thanks!