Modifications
Sauter à la navigation
Sauter à la recherche
← Modification précédente
Modification suivante →
Rasp-Hat-Moteur-Moteurs-Continus
(voir la source)
Version du 30 août 2017 à 20:15
522 octets ajoutés
,
30 août 2017 à 20:15
→Créer un objet moteur
Ligne 62 :
Ligne 62 :
myMotor = mh.getMotor(3)
myMotor = mh.getMotor(3)
</syntaxhighlight>
</syntaxhighlight>
+
+
DC motors are simple beasts, you can basically only set the speed and direction.
+
+
== Fixer la vitesse du moteur ==
+
To set the speed, call '''setSpeed(speed)''' where speed varies from 0 (off) to 255 (maximum!). This is the PWM duty cycle of the motor
+
+
<syntaxhighlight lang="python">
+
# set the speed to start, from 0 (off) to 255 (max speed)
+
myMotor.setSpeed(150)
+
</syntaxhighlight>
+
+
== Fixer le sens de rotation ==
+
To set the direction, call '''run(direction)''' where direction is a constant from one of the following:
{{Rasp-Hat-Moteur-TRAILER}}
{{Rasp-Hat-Moteur-TRAILER}}
Admin
Bureaucrates
,
Administrateurs
29 917
modifications
Menu de navigation
Outils personnels
Se connecter
Espaces de noms
Page
Discussion
Variantes
Affichages
Lire
Voir le texte source
Voir l’historique
Plus
Rechercher
Navigation
ARDUINO
RASPBERRY-PI
[:: PI Hacking ::]
Particle.IO
Micro Python
Imprimante 3D
Actualités
Modifications récentes
Page au hasard
Aide
Outils
Pages spéciales
Version imprimable