Voila, maintenant l'objet MotorHat motor HAT est créé! note that each HAT can control up to 4 motors. And you can have multiple HATs!
+
Voila, maintenant l'objet Adafruit_MotorHat est créé, nous pouvons créer un objet moteur! Notez que chaque HAT peut contrôler jusque 4 moteurs... et qu'il est possible d'avoir plusieurs HAT Moteurs le Raspberry-Pi!
−
To create the actual DC motor object, you can request it from the MotorHAT object you created above with '''getMotor(num)''' with a value between 1 and 4, for the terminal number that the motor is attached to
+
Pour créer un objet pour un moteur continu, vous pouvez demander à l'objet MotorHAT de le faire pour vous avec la fonction '''getMotor(num)''' avec une valeur entre 1 et 4 (numéro correspondant au bornier M1 à M4)
<syntaxhighlight lang="python">
<syntaxhighlight lang="python">
Ligne 63 :
Ligne 63 :
</syntaxhighlight>
</syntaxhighlight>
−
DC motors are simple beasts, you can basically only set the speed and direction.
+
Les moteurs continu sont les objets les plus simple, vous pouvez uniquement fixer la vitesse et la direction du moteur.