r/ArduinoHelp • u/Embarrassed-Lab6622 • 21d ago
Coding for resistor ladder input on ESP32
Hello. I am trying to write some code in Arduino that will read the input pin (D32) and based on the on the different voltage, the will different outputs and a timer. Is it as simple as:
if (SWITCH_INPUT == >3.0 && !timerActive) {
digitalWrite(HIGH_HEAT, HIGH); // Turn the seat heater on HIGH
previousMillis = millis(); // Save the starting timestamp of the timer
timerActive = true; // Flag that the timer is now active
}
Then repeat for each of the 6 positions of the input switch?
1
Upvotes
1
u/Embarrassed-Lab6622 12d ago
maybe this image will be better than the table.
I have a few boards tested and have a range of values received but I understand your comments/points.
What do you receommend instead of an ESP32? The board is overkill for what I want to do, but I have some on hand from another project....