const int potPin = 34; // Analog input pin for potentiometer
const int relayPin = 32; // Digital output pin for relay control
void setup() {
pinMode(potPin, INPUT);
pinMode(relayPin, OUTPUT);
}
void loop() {
int potValue = analogRead(potPin);
int mappedValue = map(potValue, 0, 4095, 0, 1023); // Example mapping to a 0-1023 range
if (mappedValue > 512) { // Example threshold for turning on the relay
digitalWrite(relayPin, HIGH); // Turn relay on
} else {
digitalWrite(relayPin, LOW); // Turn relay off
}
delay(100); // Adjust delay as needed
}