I was following a tutorial for a 2 Axis gcode interpreter, and I found serialBuffer in the code. It is supposed to start reading the buffer from the start. I then get the error "'serialBuffer' was not declared in this scope".
But I don't know how to declare it or what I could use to replace it.
Tutorial Link: How to build an 2-axis Arduino CNC Gcode Interpreter – Marginally Clever Robots
float parseNumber(char code,float val) {
char *ptr=serialBuffer; // start at the beginning of buffer
while((long)ptr > 1 && (*ptr) && (long)ptr < (long)serialBuffer+sofar) { // walk to the end
if(*ptr==code) { // if you find code on your walk,
return atof(ptr+1); // convert the digits that follow into a float and return it
}
ptr=strchr(ptr,' ')+1; // take a step from here to the letter after the next space
}
return val; // end reached, nothing found, return default val.
}