This library provides an easy and robust way to read a potentiometer or other analog input as a multi-selector switch.
AnalogSelector selector(Pin, NumPositions);
void setup() {
selector.begin();
}
void loop() {
int option = selector.getPosition();
}
This library is licensed under the terms of the MIT license. See the LICENSE file for more information.