My code is correct for push button ?
Thank you for helping and checking in advance:
LED on and Off working well, without if code
I am using
https://os.mbed.com/platforms/ST-Nucleo-L496ZG-P/#board-pinout
according
User push button connect to PC13
in while (1) loop I add this if HAL code,
set PC13 Pull-Up and Input
Am i miss any setting?
if(HAL_GPIO_ReadPin(GPIOC, GPIO_PIN_13) == 0)
{
// LED ON
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_7|GPIO_PIN_14, GPIO_PIN_SET);
HAL_Delay(1500);
// LED OFF
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_7|GPIO_PIN_14, GPIO_PIN_RESET);
HAL_Delay(1500);
}


