#include <Servo.h>

Servo servo1;
int servopin1 = 9;

int JoyHorz = A0;


void setup() {
  // put your setup code here, to run once:
servo1.attach(servopin1);
pinMode(JoyHorz, INPUT);
Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
//INPUT from the joystick + PROCESSING of the INPUT; OUTPUT of the 
int Xvalue = analogRead(JoyHorz);
Xvalue = map (Xvalue, 0, 1023, 0, 180);
servo1.write(Xvalue);
Serial.println(Xvalue);
}