uhm... here's my code and what I intend to do but it's not possible:
My global variables:
int grupos = 2; // Let's say X in a future
byte outputAddress0[8] = {22,23,24,25,26,27,28,29};
byte outputAddress1[8] = {30,31,32,33,34,35,36,37};
// byte outputAddressX[8] = {n,n,n,n,n,n,n,n};
int outputQuantity = 8; // Or increase/decrease the array size
boolean outputStatus0[8];
boolean outputStatus1[8];
//boolean outputStatusX[8];
void readOutputStatuses(){
for (int group = 0; group < grupos; group++){
Serial.print("Grupo ");
Serial.print(group);
Serial.print(": ");
for (int var = 0; var < outputQuantity; var++) {
outputStatus(group)[var] = digitalRead(outputAddress(group)[var]);
Serial.print(outputStatus(group)[var]);
}
Serial.println();
}
}
This way I can just increase the number of arrays (groups) in a future without having to use more memory. so I want to build the variable name with the first for to use in the second for inside of it but I'm having problems with this and I want to know if it's even possible to do it. My code uses 96% of the mega's memory and I'm debugging it and put it on a diet, this case repeats multiple times in my code. Thanks for the help.