I forgot to mention that for this test setup i use 2 old CD-rom steppers,
as i can figure out they have a resolution of 24 steps pr. rotation.
So, why are you telling the class that they have 20?
AF_Stepper motor1(20, 1);
AF_Stepper motor2(20, 2);
int joystick_x;
int joystick_y;
int select;
joystick_x = map(analogRead(joystick_xPin), 0, 1023, 1, 20);
joystick_y = map(analogRead(joystick_yPin), 0, 1023, 1, 20);
select = !digitalRead(selectPin);
It is quite OK to declare and initialized the variable in one step.
What do you want to do with the joystick values? Don't worry about how to do that in code. Just describe what increasing or decreasing X values should cause the one stepper to do, and what increasing or decreasing Y values should cause the other stepper to do.