I have a very basic (and perhaps very stupid) question about connecting two digital pins (Output and Input) without using ground or 5V/3.3V output.
So, the simplest example I can think of, is Digital Pin 9 is connected to a push button which is connected to a resistor(10kOhm) which is connected to Pin 8.
An ASCII drawing would look like this:
D9 - PushButton - Resistor(10kOhm) - D8
D8 is a digital input, D9 a digital output.
In all tutorials and examples, the guys are using the Ground or the 5V/3.3V output.
I have read in the documentation, that, if a pin is declared as output, it provides ~5V.
My assumption is, that if I declare a pin as input, it is also grounded.
And therefore my circuit diagram should be correct.
But is it really correct or do I have to connect a pin to the power source or the ground additionally (and if so, why?)?