mattytrentini / led_strip

Control a LED strip using an ESP8266, PWM, an N-Channel MOSFET, a rotary encoder and some Micropython
MIT License
5 stars 2 forks source link

Debouncing needs to be handled #1

Closed mattytrentini closed 7 years ago

mattytrentini commented 7 years ago

I tend to prefer hardware solutions (10nF cap across switch?). But could be done in software too.

Note that debouncing isn't really a problem when the brightness is high - the fade duration means that the debounce has stabilised by the time the fade is complete.

So, to test, reduce the brightness to the lowest setting and press the switch repeatedly. It's pretty easy to reproduce a repeat event (it will fade off then on - or vice versa - for one button click).

mattytrentini commented 7 years ago

Debouncing has been worked around; the fades always take a full second now so debouncing is no longer an issue (it was before when the fade duration could be much shorter - see #2). Resolved in 340dec9333c38d0b624a81d8aff5eacc1dfdec87.