Proper formatting of G-Code in Firmware

Hello,

I’m new to using github, arduino type boards, and modifying firmware; was hoping to get a quick check before I screw up my new lowrider.

#1 - I purchased the rambo board (5 drivers), LCD, and tiny touch plate from Ryan; I should be downloading this firmware package for a serial wired lowrider 2 (no modifications) as of 4/22/2021 correct?
V1CNC_Rambo-2.0.7.2-src.zip

#2, I’d like to create some custom G-code commands on the LCD screen. I think I have it mostly figured out thanks to other helpful posts but am not sure how to link together multiple gcode commands, are any punctuation marks needed between the G codes?

Here’s what I have currently, I have only edited the last line; all the rest included for context/error checking.

(sorry, can’t figure out how to make this formatted in code format)

#if ENABLED(CUSTOM_USER_MENUS)
#define CUSTOM_USER_MENU_TITLE "V1 Custom Menu"
#define USER_SCRIPT_DONE "M117 User Script Done"
#define USER_SCRIPT_AUDIBLE_FEEDBACK
//#define USER_SCRIPT_RETURN  // Return to status screen after a script
#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"
#define USER_DESC_4 "Z Probe"

#define USER_GCODE_4 “G90 G92 X0 Y0 Z0 G00 Z5.0000 F500 G28 Z G92 Z0.5 G00 Z5.0000 F500 M00”

You’ll want to separate commands with \n, which is the character for a new line.

#define USER_GCODE_4 “G90\nG92 X0 Y0 Z0\nG00 Z5.0000 F500\nG28 Z\nG92 Z0.5\nG00 Z5.0000 F500\nM00”

Dang Jeffe! I’m always impressed, and thankful, for you quick responses! There’s very few topics I’ve read where you don’t have some kind of input. Its been said before and can’t be said enough, thanks for helping us newbs out! To Ryan too for making a platform easy enough for non-hackers to set up.

I was able to change up the LCD menu a bit more to my liking. Homing got changed to “go to 0,0” since I don’t have endstops, addition of single point z probing, and a shortcut to “lemme see” what I made by moving the gantry along the y axis without having to do lots of manual moves. Only took about another 5 minutes to figure out the power supply and USB had to be plugged in after seeing a
avrdude: stk500v2_ReceiveMessage(): timeout
error and another 15 to remember the top outlets in my living room aren’t powered without turning on a light switch lol (the LCD screen not turning on finally clued me in)

Anyways-got it going after the helpful forums and documentation. So much fun!

1 Like

The final code in case somebody else stumbles across this with the same question - change in the configuration_adv.h of the firmware then reflash.

#define CUSTOM_USER_MENU_TITLE "V1 Custom Menu"
  #define USER_SCRIPT_DONE "M117 User Script Done"
  #define USER_SCRIPT_AUDIBLE_FEEDBACK
  //#define USER_SCRIPT_RETURN  // Return to status screen after a script
   #define USER_DESC_1 "Reset All Coordinates"
  #define USER_GCODE_1 "G92 X0 Y0 Z0"
  #define USER_DESC_2 "Go to 0,0 X&Y"
  #define USER_GCODE_2 "G90\nG00 X0 Y0"
  #define USER_DESC_3 "Probe Z"
  #define USER_GCODE_3 "#define USER_GCODE_4 “G90\nG92 X0 Y0 Z0\nG00 Z5.0000 F500\nG28 Z\nG92 Z0.5\nG00 Z5.0000 F500\nM00”"
  #define USER_DESC_4 "Lemme See!!"
  #define USER_GCODE_4 "#define USER_GCODE_4 “G90\nG00 Y50"
1 Like

I’m happy to assist. But you did the hard work. Nice job.