#include <Servo.h>
Servo YawServo; // creates a servo object
Servo PitchServo;
Servo WristServo;
Servo ClawServo;
int yaw = A1;
int pitch = A2;
int wrist = A3;
int claw = A4;
int Y;
int P;
int W;
int C;
void setup() {
YawServo.attach(9);
PitchServo.attach(3);
WristServo.attach(5);
ClawServo.attach(6);
}
void loop() {
Y = analogRead(yaw);
P = analogRead(pitch);
W = analogRead(wrist);
C = analogRead(claw);
Y = map(Y, 0, 1023, 0, 180);
P = map(P, 0, 1023, 0, 180);
W = map(W, 0, 1023, 0, 180);
C = map(C, 0, 1023, 0, 180);
YawServo.write(Y);
delay(15);
PitchServo.write(P);
delay(15);
WristServo.write(W);
delay(15);
ClawServo.write(C);
delay(15);
}