General Purpose Input/Output (GPIO)

Pros: Simple, Requires a single pin

Cons: Not good for sending complex data

By far the simplest form of communication is via General Purpose Input/Output (GPIO). GPIO isn't really a 'protocol'. It is a rudimentary form of communication where you use code to turn a pin on and off or read its state, one pin at a time.

General Information: GPIO

Input

When acting as a digital input, a pin can be queried in software and will return a value indicating the current state of the pin: high (1 or true) or low (0 or false). This is great for connecting things like switches, buttons, and even motion detectors.

Output:

When acting as a digital output, a pin can be set to one of two states: high (on/1/true) or low (off/0/false). High means the main board will set that pin to be 3.3V and low means it will set it to 0V. Note these states can be reversed by changing the programming of the pin.

Using a GPIO pin as an output is most useful as a means of turning a light or other appliance on or off.


Last modified: Monday, August 29, 2022, 9:34 PM