Hello, I have an input with following structure: [val1, val2, val3, val4] even with the brackets and the commas. Now I want to extract each value and store it in a seperate variable. I tried using sscanf() but I keep getting errors. Here is my code:
int mode, data_val1, data_val2, data_val3;
char *serialData = [1, 69, 153, 77];
void setup(){
Serial.begin(9600);
}
void loop(){
sscanf(serialData, [%d, %d, %d, %d] mode, data_val1, data_val2, data_val3);
}
The error I am getting is:
Compilation error: expected identifier before numeric constant
What is the problem?