As you see, you only need two pins ![]()
But yes, but it's a bit ugly.
byte mode = digitalRead(SwitchPins[0]) || digitalRead(SwitchPins[1]) << 1;
With SwitchPins the pins of the switch. But because they are similar, arrays, always arrays ![]()
As you see, you only need two pins ![]()
But yes, but it's a bit ugly.
byte mode = digitalRead(SwitchPins[0]) || digitalRead(SwitchPins[1]) << 1;
With SwitchPins the pins of the switch. But because they are similar, arrays, always arrays ![]()