Calling up Gcode Without Serial Input

Hello,

I am using the synthetos gshield V5 with an Arduino Uno Rev3. I am currently sending gcode through the serial monitor to move my two 2.7V 1.0A stepper motors to do 6 different movements. I have the Grbl library loaded onto my Arduino's chip. My gcode lines are very short (example: G00 X1000 Y200)

My questions is:

Can I use a sketch to call up these 6 gcodes with if statements related to 6 buttons rather than using my computer to send the code? My end result would be to make my unit mobile.

Not looking to have anyone write code for me, just want to know if this is possible/feasible/the completely wrong way to approach this. I have an Adafruit LCD shield that I would like to use with this project as well but that could be a question for another time :slight_smile:

Thank you in advance for any advice or help!

Yes.

Without opening up the library, I'm guessing that it doesn't have its own connection to the serial port. It must have a mechanism for feeding strings into it from a buffer which you control.

If it does not, and the library manages the serial port itself then you will either have to hack the library, find another one or write your own from scratch.

Lots of 3D printer firmwares can print from SD card so what you are asking is not rare or unusual.

Thank you so much for the advice MorganS! I will begin tying out some sketches immediately.