const int potPin = 33; // GPIO pin for the potentiometer
const int ledPin = 16; // GPIO pin for the LED
void setup() {
pinMode(potPin, INPUT);
pinMode(ledPin, OUTPUT);
}
void loop() {
int potValue = analogRead(potPin); // Read the potentiometer value
int brightness = map(potValue, 0, 4095, 0, 255); // Map the potentiometer value to LED brightness
analogWrite(ledPin, brightness); // Set the LED brightness
Serial.println(potValue); // Print the potentiometer value to the serial monitor
delay(100); // Adjust the delay as needed
}