#include <Servo.h>
Servo myservo;
int pot = A0;
int val;
void setup() {
myservo.attach(3);
}
void loop() {
int val = analogRead(pot);
val = map(val, 0, 1023, 0, 90);
myservo.write(val);
delay(20);
}
#include <Servo.h>
Servo myservo;
int pot = A0;
int val;
void setup() {
myservo.attach(3);
}
void loop() {
int val = analogRead(pot);
val = map(val, 0, 1023, 0, 90);
myservo.write(val);
delay(20);
}