Hi,
You will e better offt o develop your code in stages, using the example I linked in the previous post is a good start to getting your project going.
You will notice that the analog value that appears in the code from your A0 is a number from 0 to 1023.
I would suggest you do not convert it to a voltage in the code as you are only looking at some ON/OFF outputs controlled by the input level.
That sample code will show you what values you get for the extremes of your joystick travel and also when the joystick is central.
You can expect a center value of about 512, do not expect 0 and 1023 for the joystick extremes, this is dependent on the quality of the joystick mechanics and the potentiometer.
As for controlling your relays, the Arduino cannot supply on its outputs enough current to drive a relay coil, so a BJT transistor or MOSFET will need to be used to interface between the Arduino and relay.
Tom.... ![]()