Looking for a little guidance here. I am trying to setup an application that has 16 text boxes on a Nextion basic display. I would really like to set it up where I can iterate through the boxes to update the information. Here is my setup:
#include <Nextion.h>
#define TEXT_TYPE 0;
const int numTextBoxes = 16;
NexText myText[numTextBoxes];
for (int i = 0; i < numTextBoxes; i++) {
char textBoxName[4] = {"t"};
strcat(textBoxName, '0' + i);
myText[i] = NexText(TEXT_TYPE, i+1, textBoxName);
}
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
Just trying to create the array and I get the following error:
no matching function for call to 'NexText::NexText()'
I am at a loss as to the proper way to initialize the array. Any help would be appreciated.
Thanks for all the help.
There is more to the class, but it all revolves around getting/setting text, colors, fonts...
I was just looking for an easy way to run through creating/modifying all the text boxes without having to individually create each one and maintaining each one. I have been able to do this with other variables (the actual text for each box, relay switching. I just can't figure out how to create an array of Nextion text boxes (or any other Nextion object - they all have additional parameters like the NexText object above.)