STM32——CubeMX生成LL库输出PWM
-
配置
-
输出驱动
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_TIM3_Init();
MX_TIM4_Init();
MX_USART1_Init();
/* USER CODE BEGIN 2 */
LL_TIM_CC_EnableChannel(TIM3, LL_TIM_CHANNEL_CH1);
LL_TIM_EnableCounter(TIM3);
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
Plus+=10;
LL_TIM_OC_SetCompareCH1(TIM3,Plus);
LL_mDelay(100);
if(Plus>1000)
Plus=0;
}