const int potPin = 34; // Potentiometer connected to GPIO 34 (ADC)
const int ledPin = 12; // LED connected to GPIO 2
void setup() {
pinMode(ledPin, OUTPUT);
}
void loop() {
int potValue = analogRead(potPin); // Read potentiometer value (0-4095)
int brightness = map(potValue, 0, 4095, 0, 255); // Map value to 0-255 for LED
analogWrite(ledPin, brightness); // Adjust LED brightness
}