#define LED_PIN 5
#define POT_PIN 34
void setup() {
Serial.begin(115200);
pinMode(LED_PIN, OUTPUT);
}
void loop() {
int potValue = analogRead(POT_PIN); // 0-4095 on ESP32
int brightness = map(potValue, 0, 4095, 0, 255); // Convert to 0-255
analogWrite(LED_PIN, brightness); // Adjust LED brightness
Serial.print("Potentiometer: ");
Serial.print(potValue);
Serial.print(" Brightness: ");
Serial.println(brightness);
delay(50);
}