#include <Servo.h>
const int SERVO_PIN = 9;
const int POTENTIOMETER_PIN = A0;
Servo MijnServo;
void setup() {
MijnServo.attach(SERVO_PIN);
}
void loop() {
int huidigePotHoek = analogRead(POTENTIOMETER_PIN);
int nieuweServoHoek = map(huidigePotHoek, 0, 1023, 0, 180);
MijnServo.write(nieuweServoHoek);
}