FortySevenEffects / arduino_midi_library

MIDI for Arduino
MIT License
1.56k stars 252 forks source link

Request for example of multiplexer #276

Open HanalogInstruments opened 2 years ago

HanalogInstruments commented 2 years ago

Hi,

Could you made example code of the CD4051 multiplexer with 8 faders? because i use v-usb on atmega328p-pu ( Usnoobie project ) chip to build midi controller

Best regards,

franky47 commented 2 years ago

The Arduino playground already has some examples about this:

https://playground.arduino.cc/Learning/4051/

The crux of it is:

  1. Select a fader by setting the three addressing pins
  2. Read its value using analogRead on a single ADC input connected to the CD4051
  3. Repeat

How this relates to your MIDI application is up to you.