Now that we know how buttons work and how to wire one up to the Pi, let's add two buttons to our RGB LED project.
Before we wire up our buttons, we're going to need to do some housekeeping on our current wiring setup.
From here on, we'll be needing more access to power and GND pins, and we don't want a ton of really long wires criss-crossing our projects. So the first thing we'll do is a little hardware refactoring.
- Take the RGB LED ground off the cobbler row.
- Take the VCC and GND from the GPIO expander off the 5V and GND cobbler rows.
- Place a wire between the 5V row of the cobbler and the outer long row (if there's one marked red and one blue, use red).
- Place a wire between a GND pin of the cobbler and the other outer row.
- Plug the RGB LED ground into the side rail you linked to the GND on the cobbler.
- Plug the GND from the GPIO expander into the side rail linked to GND on the cobbler, and the VCC into...