ok is clear enought i got it.
i have one more small problem.
case 0xB it pass the information to the vumeter function,
void vumeter(byte channel, byte number, byte value) {
me i want to make a second function
like this
void vumeter_mainAmplifire(byte channel, byte number, byte value) {
and i will add a button. in voice loop so i can chose witch function to call.
hot to replace the xxxxx for this function please.
void loop() {
currentState = digitalRead(vu_switch);
if (currentState != previousState & currentState == LOW)
{
state = !state;
}
if (state == 0) {
xxxxxxxxxxxxxxxxxxx (vumeter);
} else {
xxxxxxxxxxxxxxxxxxxx (vumeter_mainAmplifire);
}
previousState = currentState;
}
void loop() {
midiEventPacket_t rx = MidiUSB.read();
switch (rx.header) {
case 0xB:
vumeter(
rx.byte1 & 0xF, //channel
rx.byte2, //cc
rx.byte3 //value
);
break;
}
}
void vumeter(byte channel, byte number, byte value) {
int value_ = value;
if (value_ != ccLastValue) {
if (channel == VU_MIDI_CH) {
if (number == 12 ) {
switch (value_) {
//led in row 2 are light acording to the case
case 0: