Question
How to light up LED with a switch on the STM32 Board?
while (1)
{
HAL_GPIO_WritePin(LD2_GPIO_Port, LD2_Pin, GPIO_PIN_RESET);
if (HAL_GPIO_ReadPin(B1_GPIO_Port, B1_Pin)) {
HAL_GPIO_WritePin(LD2_GPIO_Port, LD2_Pin, SET);
}
}
}
I am using the STM32 WB55 Nucleoboard, I am wondering why when I press the button on the board it doesn't light up the LED. Is something wrong with my code?
