#include <Servo.h>
Servo myservo1;
Servo myservo2;
int val;
int val2;
void setup(){
myservo1.attach(10);
myservo2.attach(9);
Serial.begin(9600);
}
void loop(){
/*two potentiomiters control two servos*/
val = analogRead(0);
val = map(val, 0, 1023, 0, 179); // scale it to use it with the servo (value between 0 and 180)
myservo1.write(val); // sets the servo position according to the scaled value
delay(15);
val2 = analogRead(1);
val2 = map(val2, 0, 1023, 0, 179); // scale it to use it with the servo (value between 0 and 180)
myservo2.write(val2); // sets the servo position according to the scaled value
delay(15);
}