Help with potentiometer

If the slider is between the two end points, it might not make contact with something. When an input pin is not connected, the value can be anything and it might pick up static electricity.