#Include Servo
#Include Servo
h>
void setup() {
// Initialize servos and set initial positions
for (int i = 0; i < DOF; i++) {
servos[i].attach(servoPins[i]);
angles[i] = 90; // Start at mid-position
servos[i].write(angles[i]);
}
void loop() {
// Read joystick inputs
int xVal = analogRead(joyX);
int yVal = analogRead(joyY);
int buttonState = digitalRead(joyButton);
// Joystick parameters
const int center = 512; // Approximate center value of joystick
const int deadZone = 100; // Dead zone to prevent drift
const int maxSpeed = 5; // Maximum angle change per loop