to my arduino boards so that I have 10 separate digital inputs of 0 or 1. How should I connect these? Is that also with resistors? If so, how?
Thanks in advance!
The code starts with a macro to make your code a little more readable. LOW and HIGH just mean that, SWITCHON makes it clear that LOW means that the switch is on.
The two for-loops use a calculation (sizeof(switchPins) / sizeof(switchPins[0]) to calculate the number of pins and iterate through the pins.