error messages and trouble shooting

I have been struggling with the error message that is ‘data’ was not declared in this scope.
I have been working at this problem for hours now and for the life of me I just cannot find the issue. I don’t know if I am just missing something very simple or not but I really would like someones help with this. My code is here-


Servo serX;
Servo serY;

String serialData;

void setup() {

void loop() {


void serialEvent(){
serialData = Serial.readString();


int parseDataX(String date) {
data.remove(data.indexOf(“X”), 1);

return data.toInt();

int parseDataY(String date) {
data.remove(0, data.indexOf(“Y”) + 1);

return data.toInt();


If someone could please help me with my issue that would be greatly appreciated

thank you

The parameter you pass has the name "date" and not "data". Since you used date and data with the same things, this is prob. your problem.

Did you really worked on this problem for hours? It is a typo man...

It is a typo man...

If this is true (I think so), the typo also appears in more than one place.