pfeerick / elapsedMillis

Arduino 'port' of the elapsedMillis library
MIT License
84 stars 26 forks source link

elapsedSeconds has unnecessary float math #12

Closed EeroFluge closed 4 years ago

EeroFluge commented 4 years ago

The elapsedSeconds class uses millis()*0.001 several times, which requires conversion to float and then back to unsigned long. I changed the expression to millis()/1000, which preserves integer math, and the class works as intended.

Also, elapsedSeconds needs to be added to the Keywords file.

pfeerick commented 4 years ago

That it does... thanks for the suggestion! I'll make that change and push a new release it in the next day or so. I'd already corrected the keywords.txt, but either haven't committed or pushed it. Thanks for catching that too! 🙂

pfeerick commented 4 years ago

Committed in https://github.com/pfeerick/elapsedMillis/commit/bab00ea6fd9202b8f3ef344ac7abdfd06c173b91