joystick che comanda relè

Nel codice hai indicato A1 come entrata analogica, non è che hai collegato il joy ad A0?