G4 Macro to add Param S for seconds

Simply adds seconds so you don’t have to Math, useful for transitioning from Marlin as they already have P or S in the G4 command.

[gcode_macro G4]
rename_existing: G4.1
gcode:
  {% set SEC = params.S|default(0)|int %}
  {% set MILI = params.P|default(0)|int %}
  {% if 'P' in params %}
    G4.1 P{MILI}
  {% elif 'S' in params %}
    {% set F = 1000*SEC %}
    G4.1 P{F}
  {% endif %}

2 Likes

It will be a very novice question … if we want to add a wait after reaching the bed temperature value as an example for use, can write “G4 s180” instead of “G4 180000”.