Ouvrir le menu principal
Accueil
Au hasard
Connexion
Configuration
À propos de Polybot Grenoble
Avertissements
Polybot Grenoble
Rechercher
Modifications
← Modification précédente
Modification suivante →
Guide STM32CubeIDE
(voir la source)
Version du 7 mars 2021 à 01:06
3 octets ajoutés
,
7 mars 2021 à 01:06
→Programmation
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>
Errikos Messara
Administrateurs
118
modifications