Modifications

Sauter à la navigation Sauter à la recherche
3 octets ajoutés ,  7 mars 2021 à 01:06
Ligne 117 : Ligne 117 :  
<syntaxhighlight lang="cpp">
 
<syntaxhighlight lang="cpp">
 
HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_1);
 
HAL_TIM_PWM_Start(&htim2, TIM_CHANNEL_1);
htim2.Instance->CCR1 = 1000; // 10000/20000 = 0.5 (duty cycle)
+
htim2.Instance->CCR1 = 10000-1; // 10000/20000 = 0.5 (duty cycle)
 
</syntaxhighlight>
 
</syntaxhighlight>
  

Menu de navigation