I think adding a physical button, wired to an unused input pin, that triggers some custom gcode would be quite tricky. You’d have to understand a lot about the fundamental control flows within Marlin to get it right
OTOH adding a new custom command to the existing menu should be much easier. Search the code for the existing custom commands, and hopefully it’s designed to be easy to understand, copy and tweak.
Or you could have a file on your SD card that just contains the GCode to do what you want, and ‘print’ that file. Something like “G0 X70 Y110”
Cool. I never consider Ed loading the am card with pre built gcode.
I really want to build a pendant/controller but there seems to be limited options.
One question. There is a build in home all feature in the menu, as well as the custom commands. I have never looked into it. But is there a faq/guide/best practises?
I want to customise my menus a bit and remove stuff I might trigger or not use. Like the extruder. …
One other thing that frustrates me, but I attribute it to the ramps board. It’s not capable of multiple commands. If I cancel a job because something slipped or I missed a step. It has to finish the last command before it will accept a cancel.
If you’re still interested, I looked into this (because I’d like add a ‘goto 0’ and ‘goto top left’ command) and it looks really easy. In Configuration_adv.h, there’s a G-code Macros section, and the standard items look like this:
#define USER_DESC_1 "Reset All Coordinates"
#define USER_GCODE_1 "G92 X0 Y0 Z0"
#define USER_DESC_2 "Home Z Axis"
#define USER_GCODE_2 "G28 Z"
#define USER_DESC_3 "Home X&Y"
#define USER_GCODE_3 "G28 X Y"