#define LED_PIN 3
#define POTENTIOMETER_PIN A7
void setup()
{
pinMode(LED_PIN, OUTPUT);
pinMode(POTENTIOMETER_PIN, INPUT);
Serial.begin(9600);
}
void loop()
{
int potentiometerValue = analogRead(POTENTIOMETER_PIN);
Serial.println(potentiometerValue);
int brightness = map(potentiometerValue,0,1023,0,255);
analogWrite(LED_PIN, brightness);
}