#include <Servo.h>
Servo myServo;
int potPin = A0;
void setup() {
myServo.attach(3); // Attacher le servomoteur à la broche 9
}
void loop() {
int potValue = analogRead(potPin);
int servoPos = map(potValue, 0, 1023, 0, 180);
myServo.write(servoPos);
delay(15);
}