const int PIN_LED = 3;
const int PIN_POT = 0;
const int MAX_VALUE_POT = 1024;
const int MAX_VALUE_LED = 254;
void setup() {
pinMode(PIN_LED, OUTPUT);
}
void loop() {
int currentPOT = analogRead(PIN_POT);
int brightness = map(currentPOT, 0, MAX_VALUE_POT, 0, MAX_VALUE_LED);
analogWrite(PIN_LED, brightness);
}