Bonjour,
J'ai une structure avec 6 servomoteurs. Avant tout je précise... Je suis novice. Je souhaiterais donc contrôler mes servomoteur et leur vitesse. Pour ce faire j'ai utilisé l'exemple fourni dans arduino.
#include <Servo.h>
Servo myservo; // create servo object to control a servo
// twelve servo objects can be created on most boards
int pos = 0; // variable to store the servo position
void setup() {
myservo.attach(27); // attaches the servo on pin 27 to the servo object
for (pos = 68; pos <= 100; pos += 1) { // goes from 68 degrees to 100 degrees
// in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(50); // waits 50ms for the servo to reach the position
}
for (pos = 100; pos >= 68; pos -= 1) { // goes from 100 degrees to 68 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(50); // waits 50ms for the servo to reach the position
}
for (pos = 68; pos <= 40; pos += 1) { // goes from 68 degrees to 40 degrees
// in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(50); // waits 50ms for the servo to reach the position
}
for (pos = 40; pos >= 68; pos -= 1) { // goes from 40 degrees to 68 degrees
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(50); // waits 50ms for the servo to reach the position
}
}
Ma problématique c'est que la première partie ou mon servo va à gauche (68->100) et se recentre (100->68) fonctionne, par contre quand je lui demande d'aller à droite (68->40) ne fonctionne pas.
Quelqu'un peut-il m'aider ?
Merci par avance