If I measure the voltage on disconnected pin 10, it is 4.85 v.
If I connect pin 10 to a pulldown resistor (100k connected to ground), the voltage on the resistor is 3.53 (not 0 v).
If I comment the digitalRead in loop() things changes:
If I measure the voltage on disconnected pin 10, it is 0 v.
If I connect pin 10 to a pulldown resistor, the voltage on the resistor is 0 v.
With pin 5 instead of pin 10, voltage on the pin is 0, either when floating pin or with pulldown resistor, even if I read its value in loop().
Thanks for your help, I have already red some articles about inputs and floating pins, but I am still confused.
I need to spend more time on this subject.
A multimeter on a floating pin is going to act as a pull-down resistor as they generally have
10M input impedance. If the pin is undamaged that is plenty and an input pin should read
0V, since the pin's impedance is in the 10^10 ohm range.
The pin in question is either fried or connected to some other trace on the board.