Thank you for your help.
I was trying to include it in this sketch but as you can see I used the same parameters for all four inputs.
I'll have to have another think now and use the axes from the joystick and something else for the buttons. Although one of the buttons is the joystick press down.
// joystick and joystick button plus extra button (B) control for arduino. 4 servos'.
//include library for servo control
#include <Servo.h>
// Define servos
Servo servo1;
Servo servo2;
Servo servo3;
Servo servo4;
// Assign analog pin numbers
int joyX = A0;
int joyY = A1;
int joyZ = A2;
int joyB = A3;
int joyVal;
void setup()
{
// attach servos to digital pins
servo1.attach(2);
servo2.attach(3);
servo3.attach(4);
servo4.attach(5);
}
void loop()
{
//read joystick value
joyVal = analogRead (joyX);
joyVal = map (joyVal, 0, 1023, 0, 180);
servo1.write(joyVal);
joyVal = analogRead (joyY);
joyVal = map (joyVal, 0, 1023, 0, 180);
servo2.write(joyVal);
delay(20);
joyVal = analogRead (joyZ);
joyVal = map (joyVal, 0, 30, 30,0);
delay(20);
servo3.write(30);
delay(20);
joyVal = analogRead (joyB);
joyVal = map (joyVal, 0, 90, 90,0);
delay(20);
servo4.write(90);
delay(20);
}