//P.c.L. = Potentiometer-controlled LED
const int AP=A0; //Analog pin 0
const int LP=9; //Digital pin 9
int sensorValue=0;
int outValue=0;

// the setup routine runs once when you press reset:
void setup(){
  //Communication: 9600 bits per second...
  Serial.begin(9600);
}

// the loop routine runs over and over again forever:
void loop(){
  sensorValue = analogRead(AP);
  Serial.print("Input: ");
  Serial.println(sensorValue);
  outValue=map(sensorValue, 0, 1023, 0, 255);
  //0-1023(Potentiometer values) -> 0-255 (LED values)...
  Serial.print("Output: ");
  Serial.println(outValue);
  analogWrite(LP, outValue);
  delay(400);
}