#include <Servo.h>
Servo xservo;
Servo yservo;
int vertical = 1;
int horizontal = 0;
int vertval = 0;
int horzval = 0;
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(vertical, INPUT);
pinMode(horizontal, INPUT);
xservo.attach(3);
yservo.attach(5);
}
void loop() {
// put your main code here, to run repeatedly:
vertval = map(analogRead(vertical), 0, 1023, 0, 180);
horzval = map(analogRead(horizontal), 0, 1023, 0, 180);
xservo.write(horzval);
yservo.write(vertval);
Serial.print("X = "); Serial.println(horzval); Serial.print("\n");
Serial.print("Y = "); Serial.println(vertval); Serial.print("\n");
delay(1000);
}