void setup() {
  // put your setup code here, to run once:
pinMode(11,OUTPUT);
pinMode(A2,INPUT);
Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
 int x=analogRead(A2);
 Serial.print("x:");
 Serial.println(x);

int y=map(x,0,1023,0,255);
Serial.print("y:");
Serial.println(y);
analogWrite(11,y);
delay(5000);
}