1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| #include <Servo.h> // inclusion de la librairie Servo
Servo myservo3, myservo5, myservo6, myservo9, myservo10, myservo11; // déclare une variable de type Servo appelée myservo
void setup()
{
myservo3.attach(3); // associe le servomoteur à la broche 9
myservo3.writeMicroseconds(1500); // positionne le servomoteur au milieu
myservo5.attach(5); // associe le servomoteur à la broche 9
myservo5.writeMicroseconds(1000); // positionne le servomoteur au milieu
myservo6.attach(6); // associe le servomoteur à la broche 9
myservo6.writeMicroseconds(1500); // positionne le servomoteur au milieu
myservo9.attach(9); // associe le servomoteur à la broche 9
myservo9.writeMicroseconds(1500); // positionne le servomoteur au milieu
myservo10.attach(10); // associe le servomoteur à la broche 9
myservo10.writeMicroseconds(2000); // positionne le servomoteur au milieu
myservo11.attach(11); // associe le servomoteur à la broche 9
myservo11.writeMicroseconds(1500); // positionne le servomoteur au milieu
}
void loop() {} |
Partager