-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESP32 specific bug: GetWordValue returns wrong value #3
Comments
I saw the same - this is an issue to For me it helped to just remove/comment-out the part removing spaces and tabs:
This relaxed the parsing and conversion with EDIT: In my case the command look like |
I have the same Issue on a RP2040 when parsing this String "G0 Z0 X300 Y100". |
@JoeLoginIsAlreadyTaken have you found a solution? |
Yes @brmarkus, keeping the spaces had helped. Here is an other solution. I added a new function to search from the start-pointer to the next char from "wordLetter" which are the valid gcode letters.
Then i changed "GetWordValue" to use this.
It is also needed to add the prototype of the new function to the header file. So far this works for me, but im new to gcode processing at all - so be careful. |
@brmarkus @JoeLoginIsAlreadyTaken I will look into this. |
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:
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
The text was updated successfully, but these errors were encountered: