Modifications

Sauter à la navigation Sauter à la recherche
576 octets ajoutés ,  24 octobre 2021 à 16:54
Ligne 60 : Ligne 60 :  
[[Fichier:MicroPython-Hack-Mosfet-10.jpg|800px]]
 
[[Fichier:MicroPython-Hack-Mosfet-10.jpg|800px]]
 
   
 
   
  <nowiki> tralala
+
  <nowiki>  
 +
>>> from pyb import Timer
 +
>>> tim = Timer( 2, freq=10000 ) # 10 KHz
 +
>>> tchannel = tim.channel( 1, Timer.PWM, pin=pyb.Pin.board.X1, pulse_width=0 )
 +
>>> tchannel.pulse_width_percent( 100 )
 +
>>> tchannel.pulse_width_percent( 99 )
 +
>>> tchannel.pulse_width_percent( 50 )
 +
>>> tchannel.pulse_width_percent( 100 )
 +
>>> tchannel.pulse_width_percent( 90 )
 +
>>> tchannel.pulse_width_percent( 100 )
 +
>>> tchannel.pulse_width_percent( 60 )
 
</nowiki>
 
</nowiki>
 +
 +
A noter que le MOSFET chauffe beaucoup si la charge consomme un courant de 2A (à cycle 100%).
 +
 +
Cela représente une consommation de 12*2A = 24W... mais plus
    
== Où acheter ==
 
== Où acheter ==
29 917

modifications

Menu de navigation