I'm slowly getting my neck around sending a .txt file to the Arduino, and have got as far as receiving e.g. "G1 X345 Y6789"
Now, I can decode as far as if it's a G, do something; if it's an X, do something else etc.
But I'm receiving X345 as a string and I want to abstract the "345" string into an integer number that I can use.
It appears that atoi() will only work char-by-char i.e. x = atoi(datastring) etc.
The string may be 1-character, up to 6-characters long, so I would like a clean, simple string-to-number conversion.
What can you suggest, please?