How to make physical buttons send G-code? I want to hook up an Arduino to my Creality printer running Marlin firmware, such that I can have a few physical buttons mounted on the machine that will execute commands such as preheat, home, disable steppers, and so on, so that I don't have to navigate through the clunky LCD screen.
Ideally it would work in addition to the normal LCD and serial functionality, so it would not impede me from using Ultimaker Cura to print via USB, etc.
What is the best way to do this?
One option would be to have your printer controlled by an Octoprint server.  You would then use the Octoprint Api plugin to use your arduino to send commands to octoprint - and from there, your printer.  Octoprint has a fairly fully-featured rest api that allows you to send arbitrary GCODE to your printer (see here).  You would then hook up your buttons to some code that sends the gcode commands to the printer when pressed.  It's certainly not as simple as installing a plugin - you'll have to write some interface code, but it looks like those APIs should be able to do what you want, without interfering with the standard controls at all.