#define LEDPIN 9
#define POTIPIN A2
#define DELAY 50
void setup() {
Serial.begin(9600);
}
void loop() {
uint16_t x = 0;
x = analogRead(POTIPIN);
analogWrite(LEDPIN, x>>2);
Serial.print("x = ");
Serial.println(x);
delay(DELAY);
}