#include "stm32l0xx_hal.h" //Include the HAL library for STM32L0xx series
int main()
{
HAL_Init(); //Initialize HAL library, configure the system clock
GPIO_InitTypeDef GPIOStruct; //Initialize GPIO structure for LED pin
GPIOStruct.Pin=GPIO_PIN_4; // Configure GPIO pin PA4 as output
GPIOStruct.Mode=GPIO_MODE_OUTPUT_PP; //Push-pull output
GPIOStruct.Pull=GPIO_NOPULL; //No pull-up/pull-down
HAL_GPIO_Init(GPIOA, &GPIOStruct); //Initializes GPIO Port A with the settings specified in GPIO_InitStruct. In this case, it configures PA5 as an output pin according to the specified parameters.
//Infinite loop to blink the LED
while (1){
HAL_GPIO_TogglePin(GPIOA, GPIO_PIN_4); // Toggle the LED state
HAL_Delay(500); // Delay for 500 milliseconds
}
}