I've read the sticky. There's really no sense in posting the entire application here: it's a hundred lines or so across 5 .INOs. I'll pull out the relevant stuff:
I use all caps for constants. The BUTTONS array is defined as such:
const uint8_t BUTTONS[] = {
PI_OUTH, PI_TROR, PI_TROMR, PI_TROM, PI_TROML, PI_TROL, PI_SLANE,
PI_REOS, PI_LEOS, PI_OPTLDRN, PI_OPTLRET, PI_LSLING, PI_RSLING, PI_OPTRRET,
PI_OPTRDRN, PI_DRACD, PI_DRACR, PI_DRACA, PI_DRACC, PI_DRACU, PI_DRACL,
PI_DRACA2, PI_VUK, PI_DROPA, PI_DROPB, PI_DROPC, PI_BELMB, PI_BELME,
PI_BELML, PI_BELMM, PI_BELMO, PI_BELMN, PI_BELMT, PI_ORBLO, PI_RAMPEX,
PI_ORBLI, PI_BOSS, PI_CENTEX, PI_CENTSC, PI_ORBRI, PI_CANDLE, PI_RIGHTEX,
PI_ORBRO, PI_ORBTO, PI_LPOP, PI_TPOP, PI_RPOP, PI_LFLIP, PI_RFLIP};
PI_XXXX is another constant defined in the Pins.ino like so:
#if DUE
const uint8_t PI_OUTH = MYPIN_48; // Outhole 1.1
const uint8_t PI_TROR = MYPIN_47; // Right Trough 1.2
const uint8_t PI_TROMR = MYPIN_46; // Middle Right Trough 1.4
// and on and on...
MYPIN_XX is defined as a uint8_t as well with a specific number like
const uint8_t MYPIN_48 = 48;
Let's be a little kinder about marking 'style' points, okay?
My conclusion about them floating is because they are floating. Any static interference near the pin changes its value. Floating. Wiring the same firmware up to a physical, external pullup resistor fixes the problem. Some pins float (5, 3, 2) and some don't (13, 8, 9, 10).