-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Bug_ESP32.zip
Bug_ESP32_fixed.zip
I found an issue with GetWordValue when I ran the provide example on an ESP32 cpu:
GetWordValue returns 288 for the input "G0X120". For "G00X120" I get the correct value of 0.
Running the same code on an Arduino I always got the correct value. I fixed this by using:
if ((line[pointer + 1] == '0') && (line[pointer + 2] == 'X'))
return 0.0;
else
return (double)strtod(&line[pointer + 1], NULL);
instead of:
return (double)strtod(&line[pointer + 1], NULL);
Please run the code in Bug_ESP32.zip to see this output on an ESP32:
Ready
Command Line: G0X120Z-10F30
Comment(s):
Process G code: 288
Command Line: G0X1
Comment(s):
Process G code: 1
Command Line: G0X12
Comment(s):
Process G code: 18
Command Line: G0X120
Comment(s):
Process G code: 288
Command Line: G00X120
Comment(s):
Process G code: 0
Metadata
Metadata
Assignees
Labels
No labels