Modifications

Sauter à la navigation Sauter à la recherche
Ligne 105 : Ligne 105 :  
Nous allons donc revoir notre programme de commande du deuxième pont-h pour contrôler la vitesse moteur.
 
Nous allons donc revoir notre programme de commande du deuxième pont-h pour contrôler la vitesse moteur.
    +
<nowiki>>>> from hbridge import HBridge
 +
>>> from pyb import delay
 +
>>> MOT2_PINS = ( pyb.Pin.board.X7, pyb.Pin.board.X8 )
 +
>>> MOT2_PWM = {'pin' : pyb.Pin.board.X4, 'timer' : 5, 'channel' : 4 }       
 +
>>> h2 = HBridge( MOT2_PINS, MOT2_PWM )
 +
>>> for speed in range( 0, 100, 10 ):
 +
>>>    h2.backward( 100-speed )
 +
>>>    delay( 100 )
 +
>>> h2.halt()</nowiki>
 
   
 
   
 
{{traduction}}  
 
{{traduction}}  
29 917

modifications

Menu de navigation