So what I was wondering, was if I could use “Virtual Button” or “Virtual Pin” in-place of a physical pin in macros.
eg This section of a macro relies on a real button on my OS2 Filament sensor. Say I wanted to re-use this macro on a printer filament sensor that doesn’t have a physical button to press, how would one do this using a Macro button in the Mainsail UI?
[gcode_button sensor_fs]
#pin: PC7 # !!!!!!!!!!!!!!!!!!!!!change with the pin name to which the sensor is connected!!!!!!!!!!!!!!!!!!!!!
pin: EBBCan: PB3 # remove the negation "!" for sensor v1 - use just PA9 as example
press_gcode: # sensor released
{% if (printer.print_stats.state == "printing") %}
#PAUSE # call printer pause macto
filament_change_state1
#{% else %}
# SET_GCODE_VARIABLE MACRO=filament_load VARIABLE=loadbusy VALUE=0
{% endif %}
UPDATE_DELAYED_GCODE ID=clear_loadbusy DURATION=2
UPDATE_DELAYED_GCODE ID=clear_unloadbusy DURATION=2
SET_GCODE_VARIABLE MACRO=filament_unload VARIABLE=filamentpresent VALUE=0
release_gcode: #gcode macro for filament load, sensor pressed
{% if (printer.print_stats.state != "printing") %}
filament_load
{% else %}
M117 Printing! Can't load filament right now!
M118 Printing! Can't load filament right now!
UPDATE_DELAYED_GCODE ID=clear_display DURATION=10
{% endif %}
SET_GCODE_VARIABLE MACRO=filament_unload VARIABLE=filamentpresent VALUE=1
UPDATE_DELAYED_GCODE ID=clear_changebusy DURATION=2