Thank you both.
I am using Arduino UNO and 1.6.11 IDE.
The full error log is
Arduino:1.6.11 (Windows 7), Scheda:"Arduino/Genuino Uno"
C:\Users\TM01314\AppData\Local\Temp\arduino_modified_sketch_204130\sketch_may11b.ino: In function 'void loop()':
sketch_may11b:29: error: expected primary-expression before ']' token
midi_cc[] = {24, 25, 3, 4, 5, 7, 8, 14, 11, 0, 12, 13, 22, 2, 23, 34};//page 1
^
sketch_may11b:32: error: expected primary-expression before ']' token
midi_cc[] = {9, 16, 17, 18, 19, 1, 20, 21, 26, 27, 28, 29, 30, 31, 32, 33};//page 2
^
exit status 1
expected primary-expression before ']' token
Questo report potrebbe essere più ricco di informazioni con l'opzione
"Mostra un output dettagliato durante la compilazione"
abilitata in File -> Impostazioni
I probably solved (only from a compile point of view) by making use of an array of arrays with my two set of values.
like this
#include <MIDI.h>
#define MIDI_CHANNEL 1 //the MIDI channel you set your JU to listen to (1-16)
// Created and binds the MIDI interface to the default hardware Serial port
MIDI_CREATE_DEFAULT_INSTANCE();
const byte swButton = 2;
boolean switchState;
boolean row = 0;
//Define Pots
byte pot[2][16] = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
byte lastpot[2][16] = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}};
//Define cc number for each pot
byte midi_cc[2][16] = {{24, 25, 3, 4, 5, 7, 8, 14, 11, 0, 12, 13, 22, 2, 23, 34},
{9, 16, 17, 18, 19, 1, 20, 21, 26, 27, 28, 29, 30, 31, 32, 33}};
void setup() {
pinMode(swButton, INPUT_PULLUP);
switchState = digitalRead(swButton);
}
void loop(){
if(digitalRead(swButton) != switchState){
switchState = !switchState;
if(switchState == LOW){row = !row;}
delay(300); //cheap debounce
}
for (byte i = 0; i < 16; i++){
pot[row][i] = analogRead(i) >>3;
if(midi_cc[row][i] == 4 || midi_cc[row][i] == 5) {pot[row][i] = pot[row][i]/25;}//range 0 - 5
else if (midi_cc[row][i] < 10){pot[row][i] = pot[row][i]/42;}//range 0 - 3
if (lastpot[row][i] != pot[row][i]) {
lastpot[row][i] = pot[row][i];
MIDI.sendControlChange(midi_cc[row][i],pot[row][i],MIDI_CHANNEL);}
}
}