Problem READING PIN
Hello everyone, I am trying to read one pin with the HAL libraries, but i can not. This is my configuration:
1) I want to read the "BUTTON" pin ( PB3/PB4/PB5/PB6 )
2 I am doing this:
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
GPIO_InitStruct.Pin = GPIO_PIN_5;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
if(HAL_GPIO_ReadPin(GPIOB,GPIO_PIN_5)){
THE PROGRAM NEVER ENTERS HERE, NO MATERS THE STATE OF THE PIN
}
What i am doing wrong??
Thanks a lot!
