Start a new topic

Array of components

Is it possible to use an array of nextion components in arduino?

NexProgressBar j0 = NexProgressBar(0, 1, "j0");

NexProgressBar j1 = NexProgressBar(0, 2, "j1");

NexProgressBar j2 = NexProgressBar(0, 3, "j2");

NexProgressBar *j[2] = {&j0,&j1,&j2};

The compiler complained that there are too many initializers.

Without knowing the final answer

 - j[2]  would be for 2 items in an array:  0 and 1.

Thanks Patrick, got it working now. 

I am building 20 countdown switches, iterate through the array helps to save some writing.