const int ledPin = 2;
const int potentiometerPin = 32;
void setup() {
pinMode(ledPin, OUTPUT);
pinMode(potentiometerPin, INPUT);
}
void loop() {
int potValue = analogRead(potentiometerPin);
if (potValue > 1000) {
digitalWrite(ledPin, HIGH); // Turn on the LED
} else {
digitalWrite(ledPin, LOW); // Turn off the LED
}
delay(100); // Delay for stability
}