Modifications

Sauter à la navigation Sauter à la recherche
185 octets supprimés ,  19 avril 2015 à 12:28
aucun résumé de modification
Ligne 5 : Ligne 5 :  
== Contrôler un Servo moteur ==
 
== Contrôler un Servo moteur ==
   −
{{bloc-etroit|text=Sur la PyBoard, il y a 4 connexions spécialement dédicacée à la commande de servo-moteur hobbyiste (voyez ci-dessous pour plus de détails).  
+
{{bloc-etroit|text=There are 4 dedicated connection points on the pyboard for connecting up hobby servo motors (voyez ce-dessous).  
   −
Ces moteurs disposent de 3 fils: la masse/GND, l'alimentation et le signal. Vous pouvez les connecter dans le coin en bas à droite avec la broche de signal à l'extrême droite.  
+
These motors have 3 wires: ground, power and signal. On the pyboard you can connect them in the bottom right corner, with the signal pin on the far right. Pins X1, X2, X3 and X4 are the 4 dedicated servo signal pins.}}
   −
Les broches X1, X2, X3 et X4 sont dédicacées à la commande de 4 broches de signal pour contrôler 4 servo-moteurs différents.}}
+
[[Fichier:MicroPython-Hack-servo.jpg|480px]]
 
  −
[[Fichier:MicroPython-Hack-servo-wire.jpg|480px]]
      
== Qu'est-ce qu'un servo moteur? ==
 
== Qu'est-ce qu'un servo moteur? ==
Ligne 81 : Ligne 79 :     
== Commander un servo-moteur ==
 
== Commander un servo-moteur ==
Plug in a {{pl|64|servo-moteur SG90}} ou {{pl|85|GS5010}} to position 1 (the one with pin X1) and create a servo object using:
+
Plug in a servo to position 1 (the one with pin X1) and create a servo object using:
    
  <nowiki>>>> servo1 = pyb.Servo(1)</nowiki>
 
  <nowiki>>>> servo1 = pyb.Servo(1)</nowiki>
Ligne 113 : Ligne 111 :  
So far we have been using standard servos that move to a specific angle and stay at that angle. These servo motors are useful to create joints of a robot, or things like pan-tilt mechanisms. Internally, the motor has a variable resistor (potentiometer) which measures the current angle and applies power to the motor proportional to how far it is from the desired angle. The desired angle is set by the width of a high-pulse on the servo signal wire. A pulse width of 1500 microsecond corresponds to the centre position (0 degrees). The pulses are sent at 50 Hz, ie 50 pulses per second.
 
So far we have been using standard servos that move to a specific angle and stay at that angle. These servo motors are useful to create joints of a robot, or things like pan-tilt mechanisms. Internally, the motor has a variable resistor (potentiometer) which measures the current angle and applies power to the motor proportional to how far it is from the desired angle. The desired angle is set by the width of a high-pulse on the servo signal wire. A pulse width of 1500 microsecond corresponds to the centre position (0 degrees). The pulses are sent at 50 Hz, ie 50 pulses per second.
   −
You can also get {{pl|224|continuous rotation servo motors}} which turn continuously clockwise or counterclockwise. The direction and speed of rotation is set by the pulse width on the signal wire. A pulse width of 1500 microseconds corresponds to a stopped motor. A pulse width smaller or larger than this means rotate one way or the other, at a given speed.
+
You can also get continuous rotation servo motors which turn continuously clockwise or counterclockwise. The direction and speed of rotation is set by the pulse width on the signal wire. A pulse width of 1500 microseconds corresponds to a stopped motor. A pulse width smaller or larger than this means rotate one way or the other, at a given speed.
    
On the pyboard, the servo object for a continuous rotation motor is the same as before. In fact, using {{fname|angle}} you can set the speed. But to make it easier to understand what is intended, there is another method called {{fname|speed}} which sets the speed:
 
On the pyboard, the servo object for a continuous rotation motor is the same as before. In fact, using {{fname|angle}} you can set the speed. But to make it easier to understand what is intended, there is another method called {{fname|speed}} which sets the speed:
29 836

modifications

Menu de navigation