About Pull-Up choice in STM32F4-DISCOVERY
Hey, I have an STM32F4 discovery board which have a user button on it. I am setting button pin as input and when I try pull-down, it works as it should be,
HIGH when pressed
LOW when not pressed
But if I do not know wrong, when I choose pull-up then it should be
LOW when pressed
HIGH when not pressed
But this code below, gives me an always ON led , whether i am pressing or not.
if(HAL_GPIO_ReadPin(GPIOA, GPIO_PIN_0))
HAL_GPIO_WritePin(GPIOD, LD4_Pin, 1);
else
HAL_GPIO_WritePin(GPIOD, LD4_Pin, 0);
Thanks in advance.

