I'm new to Arduino and this forum; hopefully this is the correct place to put my question.
I am just learning and have a very simple circuit, wherein pin 2 is reading an input. If it receives a LOW input, channel 9, which is connected to an LED, gives a LOW output signal. Otherwise, channel 9 outputs a HIGH signal, and the LED receives current and lights up. My question is this: When nothing is connected to pin 2, not even a wire, it is technically receiving no current, and therefore should not allow the LED to light up, right? However, the LED is lit. Also, when I connect pin 2 to ground, however, the LED stops glowing. What is the physical difference between the 2 scenarios? How does the microcontroller "know" that channel 2 is connected to ground when in both cases it is receiving no current?