Hi! I'm new to this forum, but I use arduino since about 1 year. I'm trying to use a struct in a project, and I'm stuck with this error:
test_enum_struct_matrix.cpp:34:11: error: expected initializer before ‘nodeMatrix’
Can anyone help me finding the error please?
Here it is the code:
#define IO_COUNT_DIGITAL 54 // 0-53
#define IO_COUNT_ANALOG 16 // 0-15
// definisco una struttura dati che identifica un pin
struct pinSingleAnalog {
boolean flagReserved;
byte unsigned pinValue;
};
struct pinSingleDigital {
boolean flagInput;
boolean flagReserved;
boolean flagPwm;
byte unsigned pinValue;
};
// pins array
struct pinMatrix {
pinSingleAnalog analog[IO_COUNT_ANALOG];
pinSingleDigital digital[IO_COUNT_DIGITAL];
}
pinMatrix nodeMatrix; // matrice di tutti i pin
void setup()
{
Serial.begin(9600);
//nodeMatrix.analog[0].flagReserved = true;
//nodeMatrix.analog[2].flagReserved = true;
}
void loop()
{
for(int k=0; k<IO_COUNT_ANALOG; k++)
{
// Serial.println(pinDump(nodeMatrix[k]));
}
// Serial.println(sizeof(nodeMatrix));
}
Thanks in advance ![]()
Giuseppe