Modifications

Sauter à la navigation Sauter à la recherche
287 octets ajoutés ,  23 février 2022 à 23:29
Ligne 133 : Ligne 133 :  
[[Fichier:ENG-CANSAT-FEATHER-PICO-pwm-01.png]]
 
[[Fichier:ENG-CANSAT-FEATHER-PICO-pwm-01.png]]
   −
The average voltage of PWM signal depend on the duty cycle: Vavg = 3.3V * Th / P
+
The average voltage (average power) of PWM signal depend on the duty cycle: Vavg = 3.3V * Th / T
   −
The onboard LED is tied to the GPIO 25. And that GPIO 25 can also be controled with PWM.
+
[[Fichier:ENG-CANSAT-FEATHER-PICO-pwm-02.png|800px]]
   −
Thank to PWM we can control the effective luminosity of the LED by setting-up the duty cycle of the PWM signal.
+
Obviously, a 0% duty cyle is equivalent to a LOW signal whereas a 100% duty cycle is a HIGH signal.
 +
 
 +
In the following example, we will use PWM to dim the light on the onbloard LED.
 +
 
 +
The onboard LED is tied to the GPIO 25 (and PWM will work there as with other GPIOs).
 +
 
 +
Thank to PWM we can effectively control the LED luminosity (very low duty cycle will dim the light while highest duty cycle will make it brightest).
    
<syntaxhighlight lang="python">
 
<syntaxhighlight lang="python">
29 918

modifications

Menu de navigation