Controlling (mixing) inputs (push buttons) and outputs (LEDs) with the 74HC595 IC.
Work inspired by and adapted from Kevin Darrah's video on How to Control a Ton of Inputs using Shift Registers!. Note: In the video, Kevin shared and explained his great idea as well as his code. However, schematics/diagrams are missing, what makes the process a bit difficult to follow. In case you're wondering, this image describes the main idea:

My goal is to optimize my Soccer Penalty Kicks Game's control, which is currently working with 2 analog input reads based on resistors, controlling 12 push buttons, which, as mentioned by Kevin in his video, becomes problematic at the end of the day when having a number of inputs.
While Kevin's work handles multiple buttons (like a piano), my control has only one active button, so in the code, as soon as I identify a button press, I exit the button inspection and only light one LED.
See the source code.
See the source code.
This is what I actually needed for my game. One of the buttons triggers another action and is not connected to any LED, that's why the odd numbers :).
See the source code.
Amount | Part |
---|---|
11 | Red LED |
11 | 330Ω Resistor |
12 | Push button |
12 | Diode 1N4001 |
1 | 10kΩ Resistor |
3 | Ceramic capacitor 1µF |
1 | Electrolytic capacitor 100µF |
3 | 74HC595 Shift Register |
1 | Arduino Uno (Rev3) - ICSP |
3_daisy_chained_shift_registers_12_inputs_11_outputs.mp4
This is how the control looks ike after implementing Kevin's approach.