#define pot A0
#define LEDpin 5
void setup() {
// put your setup code here, to run once:
pinMode(pot, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
int potValue = analogRead(pot);
int LEDbrightness = map(potValue, 0, 1023, 0, 255);
analogWrite(LEDpin, LEDbrightness);
}