Control Surface
main
MIDI Control Surface library for Arduino
|
This example demonstrates the use of push buttons and LEDs and how to use shift registers and analog multiplexers to save pins.
Connect 16 momentary push buttons between the input pins of the multiplexer and ground.
The internal pull-up resistor for the buttons will be enabled automatically, so no external resistors are necessary.
Connect 16 LEDs (and series resistors) between the eight outputs of the two shift registers and ground.
Remember to connect the enable pins of both the multiplexer and the shift registers to ground in order to enable them. Also connect the master reset pin of the shift registers to Vcc.
Connect the serial data output of the first shift register (QH' or Q7S) to the serial input of the second shift register.
Pressing the first button will turn on the first LED. Pressing it again will turn it off again. Pressing the second button will turn on the second LED. Pressing it again will turn it off again, and so on.
Written by PieterP, 2018-08-28
https://github.com/tttapa/Arduino-Helpers