MIDI Footswitch

Update:
I tried turning that internal pullup in the program to LOW, and seems the same. It seems no matter what i do, it always ends up the same.
It's really frustrating =(
It keeps randomly failing to read the input i give through the footswitch. The footswitch works fine, i tested with a multimeter.
The serial comunication seems in order too, that's not where it's failing either.

Is there a simple program/circuit i can use to check if the inputs of the arduino are 100% ok?