Code Example
HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_1);
while (1)
{
for(uint16_t i=0;i<1000;i++)
{
__HAL_TIM_SET_COMPARE(&htim2, TIM_CHANNEL_1, i);
HAL_Delay(2);
}
}
How it works
This STM32 example demonstrates basic peripheral configuration and HAL usage.