ReadPin returns multiple increments when it's supposed to increment only one each ''read''
Hi all,
I want to increment the lap_marker variable only once when the lap_button is pressed, but when I press the button, it increments multiple times, untill I let go of the button (when I put a breakpoint in the loop it works fine).
I only want to increment once, Have I done something wrong? Is there another logic?
The pin is PC13, in input mode and the internal pull-down resistor activated.
Here is the code:
//Read lap button
if(HAL_GPIO_ReadPin(lap_button_GPIO_Port, lap_button_Pin))
{
lap_marker++;
}
