Control Surface
main
MIDI Control Surface library for Arduino
|
This is an example of the AnalogMultiplex class. It prints the values of all 16 inputs of a multiplexers to the serial monitor.
Optionally you can connect the enable pin as well, this is useful if you want to use multiple multiplexers with the same address lines and the same analog input. Otherwise, just connect the enable pin to ground.
If you are using a 3-bit multiplexer, like the CD74HC4051, you can uncomment the code specific to this multiplexer, and use only three address pins.
Connect some potentiometers or other analog sensors to the 16 inputs of the multiplexer, and open the serial monitor (CTRL+SHIFT+M) or the serial plotter (CTRL+SHIFT+L). You should see all 16 signals printed or plotted.
Written by Pieter P, 31-01-2019
https://github.com/tttapa/Arduino-Helpers