// Written by Scott (BRUHisbackbois#4570)
// software is a bit buggy! sorry.
#include <Servo.h>
Servo servo1;
Servo servo2;
//pins
int Joy_X = 0;
int Joy_Y = 1;
int Joy_SEL = 7;
int servo_1 = 2;
int servo_2 = 3;
int xValue, yValue, SEL;
// setup
void setup() {
Serial.begin(9600);
servo1.attach(servo_1);
servo2.attach(servo_2);
}
// mainloop
void loop() {
xValue = analogRead(Joy_X);
yValue = analogRead(Joy_Y);
xValue = map(xValue, 0, 1023, 0, 180);
yValue = map(yValue, 0, 1023, 0, 180);
// debug xValue
// control servo
servo1.write(xValue);
servo2.write(yValue);
delay(1);
}