Modifications

Sauter à la navigation Sauter à la recherche
Ligne 30 : Ligne 30 :     
== Contrôler un moteur pas-à-pas ==
 
== Contrôler un moteur pas-à-pas ==
Here's a walkthru of the code which shows you everything the MotorHAT library can do and how to do it.
     −
Start with importing at least these libraries:
+
Nous allons réviser le contenu du code permettant de prendre le contrôle du moteur à l'aide de la bibliothèque MotorHAT.
 +
 
 +
Nous commençons par importer les éléments nécessaires pour qu'ils puissent être utilisé par notre script :
    
<syntaxhighlight lang="python">
 
<syntaxhighlight lang="python">
Ligne 42 : Ligne 43 :  
</syntaxhighlight>
 
</syntaxhighlight>
   −
The MotorHAT library contains a few different classes, one is the MotorHAT class itself which is the main PWM controller. You'll always need to create an object, and set the address. By default the address is 0x60 (see the stacking HAT page on why you may want to change the address)
+
La bibliothèque MotorHAT contient quelques classes, il y a la classe MotorHAT qui est le principal contrôleur du générateur PWM. Vous aurez toujours besoin de créer un objet et de fixer l'adresse. L'adresse par défaut est 0x60 (see the stacking HAT page on why you may want to change the address)
    
<syntaxhighlight lang="python">
 
<syntaxhighlight lang="python">
29 922

modifications

Menu de navigation