Beginner: Difference between safety resistor between pin and switch, or switch and ground
Bringing a digital input to 0.5V will still register as a zero input, but in general you want digital inputs to be close to the rails. Values in the middle of the rail leave both the input transistors on and may cause damage.