[solved] Need help with GcodeCNCDemo

Home Forum Everything Else [solved] Need help with GcodeCNCDemo

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #6032
    AvatarAnonymous
    Inactive

    Hello,
    I tried the help given in the July post but I still have trouble. I’m using Arduino 1.5.7. I have motor shield version 1.2. I’ve posted as Richard on the blog. I’m hoping to use this with a XY table and a servo to lift a tool.

    With trying version 1 of the 2 axis software it will not parse the numbers correctly. I type in M114; and I display val inside parsenumber function it outputs -1.0.

    With trying version 2 of the 2 axis software, when I change to #define MOTOR_SHIELD_VERSION (1) I get;
    GcodeCNCDemo2AxisV2.ino: In function ‘void setup()’:
    GcodeCNCDemo2AxisV2.ino:322:3: error: ‘AFMS’ was not declared in this scope

    When I leave on
    #define MOTOR_SHIELD_VERSION (2) // Must choose one! I get
    GcodeCNCDemo2AxisV2.ino:40:34: fatal error: Adafruit_MotorShield.h: No such file or directory
    compilation terminated.
    I see that you mention updating the files on github but to me they still show the same files.
    https://github.com/MarginallyClever/GcodeCNCDemo

    #6767
    AvatarAnonymous
    Inactive

    how do you get this -1 value?

    What if you turn on “send carriage return” and type “M114” without the “;”?

    I checked in an update that includes arduino_libraries/ which should solve your “Where is adafruit_motorshield.h?” question.

    #6768
    AvatarAnonymous
    Inactive

    Hello,
    Thanks for the update. V2 Now compiles but still not functioning properly.

    With carriage return and no ; it just echos what I type

    When I output val inside parse number I only get . -1.00 for whatever number I use
    G00 X200;
    Val: -1.00
    Val: -1.00

    /**
    * Look for character /code/ in the buffer and read the float that immediately follows it.
    * @return the value found. If nothing is found, /val/ is returned.
    * @input code the character to look for.
    * @input val the return value if /code/ is not found.
    **/
    float parsenumber(char code,float val) {
    char *ptr=buffer;
    while(ptr && *ptr && ptr<buffer+sofar) {
    if(*ptr==code) {
    return atof(ptr+1);
    }
    ptr=strchr(ptr,' ')+1;
    }
    Serial.print("Val: ");Serial.println(val);
    return val;
    }
    #6769
    AvatarAnonymous
    Inactive

    Somewhere in the code it’s calling parsenumber(‘M’,-1); for some reason your buffer appears empty at this point, so it returns the default number -1. I have time booked tomorrow to run my test machines and see if the code is broken for everyone.

    #6770
    AvatarAnonymous
    Inactive

    I just updated and tested GcodeCNC2AxisV2. (commit #9)
    I also removed GcodeCNC2AxisV1 since the two versions are now merged.

    It worked before and after, but now I’ve added line numbering and checksums so it can be used from from gCodeSender.

    I am using Arduino 1.0.5. If you are still having trouble with 1.5.7, tell Arduino and switch back to an earlier version until they fix it.

    #6771
    AvatarAnonymous
    Inactive

    That makes it work even with 1.5.7 of Arduino. Thank you.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.