Hello I’m developing an operation that does led control with a button, I use a counter for this, but every time I hold the button, the counter increases further than 1 So indeed if I hold the button down, I want ...Read more
Hello
I’m developing an operation that does led control with a button, I use a counter for this, but every time I hold the button, the counter increases further than 1 So indeed if I hold the button down, I want it to increase once.
Read less
Perhaps you should debounce the button, as mechanical buttons bounce, i.e. may produce more than one pulse per button press. There are several techniques to do that, one of the easiest is to connect some small capacitor in parallel to the button, which together with the pull resistor forms some lowRead more
Perhaps you should debounce the button, as mechanical buttons bounce, i.e. may produce more than one pulse per button press.
There are several techniques to do that, one of the easiest is to connect some small capacitor in parallel to the button, which together with the pull resistor forms some low pass filter. The time constant of that filter should be slightly lower than the period of the maximum speed to press that button(e.g.100.200 ms). You’ll find this solution also at the NUCLEO or DISCOVERY boards.
See less