-
Notifications
You must be signed in to change notification settings - Fork 74
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
User MCode Template Questions #50
Comments
It's after midnight here and I posted my message and shut things down and left the shop. As I was about to turn in for the night I thought "I wonder if I'm blocking the light by accident". So I stuck a delay(2000) in after the rgb_set_state(RGB_WHITE) call and sure enough the light popped on. I'll improve my state handling in the morning, so you can disregard my request. Before I forget though, I did have to change something in your code to get it to compile. I changed line 86 in your mcode example from:
to
It was a guess on my part, please advise if this is a valid change. Thanks. |
If you want your plugin to be generic (usable by all drivers having enough ioports) use
It is valid, I'll fix the template. |
Yes, I would like it to be usable by all drivers. I only threw the delay in temporarily as a debug method since I knew it would block, but is that hal call a non-blocking way to generate a delay? That would be very helpful. |
Also, I noticed the "plugins" link in the last sentence of the readme summary on the Templates repo is a broken link. "The HAL supports a wide range of extension possibilities, this without touching the core grbl codebase. Some examples can be found in the plugins folder." |
I was just looking through the codes at Marlin and this one caught my eye (amusingly, only 1 off from the code I chose). Is it your preference to adopt codes already in use at Marlin, in applicable? This one is a reasonable approximation of the inspection light function I am adding: https://marlinfw.org/docs/gcode/M355.html |
First stop for determining a new M-code is LinuxCNC then Marlin. If no good match is found I try to avoid Marlin codes that has a fair chance of beeing relevant for grblHAL. |
Yes, if you supply a callback function. Note that currently only one callback can be active at any time - I plan to change this. |
The templates you recently added are great, but I haven't been able to get the user mcode example one to work. I was wondering if you could take a look and see if there is something obvious that is wrong. I copied and edited your code. It compiles fine within my tree.
I am calling the mcode from the MDI in IOSender with:
M356 Q1
and I receiveok
but nothing visible happens.Is this the correct way to call it? I'm new to user mcodes.
I have temporarily added an entry in gcode.h that looks like this:
RGB_Inspection_Light = 356, //!< 356 - M356 // ** Collides with Plasma ** On = 1, Off = 2, RGB white LED inspection light in RGB plugin
I am not currently including the plasma module and I don't see the plasma codes defined in this file, but I did notice that $356 is referred to on the github summary page. Is this possibly the issue?
Here is the code section:
The text was updated successfully, but these errors were encountered: