Hi,
I'm trying to shorten the code:
const byte led1 = 1;
const byte led2 = 2;
...
const byte led# = #;
void setup() {}
void loop() {}
into:
const char* pinLabel[] = {"led1", "led2", ..., "led#"};
const int pinNumber[] = {1, 2, ..., #};
void setup() {
for (int a = 0; a < #; a++) {
const byte pinLabel[a] = pinNumber[a];
}
void loop() {}
But I got an error message:
error: array must be initialized with a brace-enclosed initializer
const int pinLabel[a] = pinNumber[a];
It is clear that my understanding of array is wrong, any help with this?
EDIT: Sorry pressed "post" by accident.