pan and tilt using arduino uno and servo motors

Опубликовано: 13 Июль 2026
на канале: 5volt solution
160
1

val = analogRead(potpin); // reads the value of the potentiometer1 (value between 0 and 1023)
val = map(val, 0, 1023, 0, 180); // scale it to use it with the servo1 (value between 0 and 180)
myservo.write(val); // sets the servo position according to the scaled value
delay(15);
val1 = analogRead(potpin1);
val1 = map(val1, 0, 1023, 0, 180);
myservo1.write(val1);
delay(15); // waits for the servo to get there