274
int main(void) { /* MCU Configuration--------------------------------------------------------*/ HAL_Init(); // Initialize the Hardware Abstraction Layer /* Configure the system clock */ SystemClock_Config(); // Set up the system clock /* Initialize all configured peripherals */ MX_GPIO_Init(); // Initialize GPIO pins MX_TIM2_Init(); // Initialize Timer2 for PWM MX_USART1_UART_Init(); // Initialize UART for communication SendUartMessage("Initialization Completed \n\r"); // Notify that initialization is complete /* Infinite loop */ while (1) { HandleStartStop(); // Check and handle start/stop button HandleDutyCycle(); // Check and handle duty cycle button } }