#include <Servo.h>
Servo servo1;
Servo servo2;
int servopin1 = 10;
int servopin2 = 9;
int stickjoy = A0;
int joystick = A1;
void setup() {
// put your setup code here, to run once:
servo1.attach(servopin1);
servo2.attach(servopin2);
pinMode(stickjoy, INPUT);
pinMode(joystick, INPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
int Xvalue = analogRead(stickjoy);
int Yvalue = analogRead(joystick);
Xvalue = map (Xvalue, 0, 1023, 0, 180);
Yvalue = map (Yvalue, 0, 1023, 0, 180);
servo1.write (Xvalue);
servo2.write (Yvalue);
Serial.println(Xvalue);
Serial.println(Yvalue);
}