Programming code with joysticks

Hello!
Please help me as im not very good in programming and I want to make a code to control a robotic arm through a joystick. I have tried to make a code in which each joint is assigned to a letter. To select the type of joint that I want to control, through the x-axis I look for the letter to move. Once found, to be able to select it, I have to press the joystick with the z-axis, and in this way I can move freely the joint without changing the letters assigned to the other joints. To select another letter, press the z-axis again and select the next letter with the x-axis. This is the code.
Any suggestions would be great!
Thank you

//Initialize Data Structures char alphabet[] = {' ','a','d','e','f','g','h','q','r','s','t','w','y'}; char text[50] = {'-', '-', '>'}; //Initialize Counters int alphabetCounter = 0; int textCounter = 3;

//Initialize Sensor Values int sensorValueX; int sensorValueY; int sensorValueZ;

// Define angle limits float minrot0 = -360, maxrot0 = 360; float minrot1 = 30, maxrot1 = 90; float minrot2 = -120, maxrot2 = -60; float minrot3 = -360, maxrot3 = 360; float minrot4 = -60, maxrot4 = 60;

void setup() {

// initialize serial communication at 9600 bits per second: Serial.begin(9600); Serial.print(text); Serial.println(alphabet[alphabetCounter]);
}

void loop() { sensorValueX = analogRead(A0); sensorValueY = analogRead(A1); sensorValueZ = analogRead(A2); if (sensorValueX > 750 || sensorValueX < 150 || sensorValueY > 750 || sensorValueY < 150 || sensorValueZ <10){
//// X-Axis Incriment and Decriment// if (sensorValueX > 750){// alphabetCounter++;// delay(500);// }// if (sensorValueX < 150){// alphabetCounter--;// delay(500);// }

// Y-Axis Incriment and Decriment if (sensorValueY > 750){ alphabetCounter++; delay(500); } if (sensorValueY < 150){ alphabetCounter--; delay(500); }
// Z-Axis Select Character if (sensorValueZ < 10){ delay(500); }

    Serial.print(text);    Serial.println(alphabet[alphabetCounter]);//    Serial.println(alphabetCounter);//    Serial.println(textCounter);  } 

}

Welcome to the forum

Start by posting your code correctly to make it easier to provide help, and describe the problems that you have encountered

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use [color = red]code tags[/color] (the </> icon above the compose window) to make it easier to read and copy for examination

suggest you edit your post with the code properly formatted. paste it into the highlighted area after selecting the "</>" icon

curious, do you want to learn to program or just make your project work?

sounds like you want to select a letter using the x-axis joystick. but it seems that code is commented out and the code is using the y-axis joystick. And you want to en/disable the selection using the z-axis

don't see any use for the z-axis input to en/disable selection

but i don't see anything controlling a joint.

looks like you're relying on a delay to prevent advancing the selected letter too quickly. could recognize the transition from above/below a threshold

Sorry i´m new here and im trying my best
This is the new code.
Its okey like this?
Thank you

//Initialize Data Structures
char alphabet[] = {' ','a','d','e','f','g','h','q','r','s','t','w','y'};
char text[50] = {'-', '-', '>'};
//Initialize Counters int alphabetCounter = 0; int textCounter = 3;

//Initialize Sensor Values
int sensorValueX;
int sensorValueY;
int sensorValueZ;

// Define angle limits
float minrot0 = -360, maxrot0 = 360;
float minrot1 = 30, maxrot1 = 90;
float minrot2 = -120, maxrot2 = -60;
float minrot3 = -360, maxrot3 = 360;
float minrot4 = -60, maxrot4 = 60;

void setup() {

// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
Serial.print(text);
Serial.println(alphabet[alphabetCounter]);
}

void loop() {
sensorValueX = analogRead(A0);
sensorValueY = analogRead(A1);
sensorValueZ = analogRead(A2);
if (sensorValueX > 750 || sensorValueX < 150 || sensorValueY > 750 || sensorValueY < 150 || sensorValueZ <10){

//// X-Axis Incriment and Decriment//

if (sensorValueX > 750){// alphabetCounter++;// delay(500);// }//
if (sensorValueX < 150){// alphabetCounter--;// delay(500);// }

// Y-Axis Incriment and Decriment
if (sensorValueY > 750){ alphabetCounter++; delay(500); }
if (sensorValueY < 150){ alphabetCounter--; delay(500); }

// Z-Axis Select Character
if (sensorValueZ < 10){ delay(500); }

    Serial.print(text);
Serial.println(alphabet[alphabetCounter]);

// Serial.println(alphabetCounter);
// Serial.println(textCounter); }
}

Still no code tags

Edit your post
Select all of the code
Click the </> icon to add the code tags
Save the revised post

beside learning to program, need to learn to explain

would you mind responding to my comments in post #3?