The pin as a standalone component
Let's take a deep dive and look at how exactly each GPIO pin on the Pi works. Each pin has two functions, which are what make up the IO in GPIO. Each pin can write binary values (and by values, what I mean is it can give an output between 0 and 3.3v) and also read binary values.
The Write mode
In the Write mode, the Raspberry Pi acts as a switch and a power source.

This diagram represents the hello world
of circuits, that is, an LED along with a resistor connected to a power source. An important thing to remember is that any GPIO pin needs a reference, relative to which it can be high or low.
The Raspberry Pi can act as either end of this circuit and has two different ways of being an output pin based on the reference pin we use.
- The first configuration is when we use the ground pin as the reference pin.

Here, the LED pin will glow when the GPIO pin is high relative to the ground pin and will be switched off when it is low.
- If you haven't guessed it already, the...