Inputs and Outputs (Patreon)
Content
As I've said in the past, in their simplest form, every escape room puzzle can be distilled down to 3 basic steps:
1.) Detect Player Input
2.) Apply Game Logic
3.) Trigger Output
The GPIO (General Purpose Input and Output) pins on your Arduino/ESP/Raspberry Pi are therefore absolutely crucial components of every project - they're the interface by which the processor gathers inputs and controls outputs - without which you couldn't get it to do anything useful at all! No RFID readers, no magnet sensors, no relays, and no maglocks popping open... :(
I've generally tried to make my tutorials project-based, which means I've often described certain elements of working with GPIO pins as they relate to the particular project at-hand, but I don't think I've ever really tried to cover a (relatively) comprehensive overview of all the topics relating to them, so that's what I've tried to address in this video.
Specific topics I'll cover include digital/analog inputs and outputs, logic levels, floating inputs, pullup/pulldown resistors, PWM, ADC, high current applications, and port expanders.
Now, if all that sounds a bit theoretical, don't worry, I've also made sure I give you a practical demonstration of how this will all come in useful! So, I've picked two very common "GPIO-hungry" components...:
a matrix keypad input (normally requiring 8 GPIO pins), and
an LCD character display output (normally requiring 11 GPIO pins)
...and I'll show you how you can use a GPIO port expander to connect them both to your ESP8266/32/Arduino, using only 2 pins. And, you can connect more and more GPIO expanders to the same bus, to give you up to 128 GPIO ports! Just imagine the puzzles you could make with all those RFID readers.....