May 12, 2026
Description
an successfully attempt to add the direct command as macro or gcode token
#####################################################################
#####################################################################
[gcode_shell_command GANTRY_ON]
command: sh -c 'echo 1 > /sys/class/gpio/gpio79/value'
timeout: 2
[gcode_shell_command GANTRY_OFF]
command: sh -c 'echo 0 > /sys/class/gpio/gpio79/value'
timeout: 2
[gcode_macro LUCE]
description: Accende o spegne la barra LED tramite GPIO79
variable_stato: 0
gcode:
{% if printer["gcode_macro LUCE"].stato == 0 %}
RUN_SHELL_COMMAND CMD=GANTRY_ON
SET_GCODE_VARIABLE MACRO=LUCE VARIABLE=stato VALUE=1
{% else %}
RUN_SHELL_COMMAND CMD=GANTRY_OFF
SET_GCODE_VARIABLE MACRO=LUCE VARIABLE=stato VALUE=0
{% endif %}
the 3d file is only to perform the publish
License:
Creative Commons - Attribution - Share Alike
658