mwood77 / osww

The Open Source Watch Winder - a modular, simple-to-build watch winder.
Other
72 stars 5 forks source link

Bug Fix: Missed Button Press - Cleanup Logic #1

Closed danagarcia closed 1 year ago

danagarcia commented 1 year ago

Cleans up the loop logic, as well as fixes the bug of missing button presses due to using the delay function.

Usage of the delay function can cause a miss in detecting a button press. To avoid this you can utilize a time based loop delay continuously listening for the button press while locking the thread into this listening loop for a specified period of time. I've also adjusted the flat if, if else, else statements into nested ifs to save time on duplicate comparisons.

danagarcia commented 1 year ago

As a side note, I've tested this commit on my person Pi Pico and it runs well: Screen Shot 2023-03-15 at 2 16 55 AM

mwood77 commented 1 year ago

Great work 👍