Skip to content

Noob trouble - CCButton with a MUX and rising edge triggering #1000

Answered by tttapa
Jacob-Allinson asked this question in Q&A
Discussion options

You must be logged in to vote

You could use the CCButton::invert() function. For example:

// Include the library
#include <Control_Surface.h>

// Instantiate a MIDI Interface to use
USBMIDI_Interface midi;

// Instantiate an analog multiplexer
CD74HC4067 mux{
  A0,             // Analog input pin
  { 2, 3, 4, 5 }  // Address pins S0, S1, S2
};

NoteLED leds[]{
  { 1, { MIDI_Notes::C(4), CHANNEL_1 } },  // Note C4 on MIDI channel 1
  { 0, { MIDI_Notes::D(4), CHANNEL_1 } },  // Note D4 on MIDI channel 1
  { 6, { MIDI_Notes::E(4), CHANNEL_1 } },  // Note E4 on MIDI channel 1
  { 7, { MIDI_Notes::Gb(4), CHANNEL_1 } },  // Note F#4 on MIDI channel 1
  { 8, { MIDI_Notes::Ab(4), CHANNEL_1 } },  // Note G#4 on MIDI channel 1

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Jacob-Allinson
Comment options

Answer selected by Jacob-Allinson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants