If you wanted to improve the above example and reduce the Serial instructions to one there are a couple of options.
Using the library function sprintf
void setup() {
Serial.begin(9600);
}
int row=2;
int data=1;
char buffer[20];
void loop() {
sprintf(buffer, "CELL,SET,A%i,%i",row,data);
Serial.println(buffer);
delay(1000);
row++;
data++;
}
Using String()
void setup() {
Serial.begin(9600);
}
int row=2;
int data=1;
void loop() {
Serial.println(String("") + "CELL,SET,A" + row + "," + data);
delay(1000);
row++;
data++;
}
I would probably lean toward sprintf