Everything worked fine, until I switched to wireless (2.4Ghz) communication, with an arduino Mega reading my sensors and sending data (via a NRF24L01+ chip with an antenna, that thing: http://hackspark.fr/fr/nrf24l01-with-pa-and-lna-2-4ghz-rf-module-long-distance-antenna.html) to an arduino Uno which acts as a receptor and translates my data in Midi.The RF communication works quite fine, EXCEPT that I couldn't read the digital pins of my arduino mega.

Is there a trick with the Digital Pin numbers of the mega ?

Is it the MIRF library (which I use to operate the RF communication) or the SPI library messing up the use of digital pins ?

My code is attached.

I found a workaround by connecting my switches to the available analog inputs, but I'd like to use the digital ones instead.

Weird thing is that everything was working ok before switching to RF communication...