debouncing on the code

veraniumhydroxide:
Septillon, is there a formula to get the capacitance with respect to the distance of long wire? If this is implemented, the wires could reach up to more or less 300 meters for a single pushbutton input.

You may want to consider another way to get the inputs to the Arduino. 600 meters for a 5VDC signal is a *long * way. Lots of opportunities for electrical interference and attenuation. Perhaps RS-485 or a fiber optic link to the remote switches would be better.

YMMV