I can test the value of the string gCode by having it print out as G2 or G3, yet it never triggers the if function by the string comparison to "G2" or "G3".
if (gCode =="G2") {
dir = 0;
Serial.println ("G2 code move");
arc(cX, cY, endX, endY, dir); // (cX, cY, endX, endY, dir) temporary experiment
}
if (gCode=="G3") {
dir = 1;
Serial.println ("G3 code move");
arc(cX, cY, endX, endY, dir); // (cX, cY, endX, endY, dir) temporary experiment
}
What could I be doing wrong? The entirety of the code is too long to post.
I am getting the contents for gCode from:
strtokIndx = strtok(NULL, ","); // get the string, perhaps G or M command
strcpy(gCode, strtokIndx); // copy it to gCode