Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Gcode variables
- # ADD_VARIABLE will add one to the value of the stored my_variable.
- # GCODE_VARIABLES is just there to store the variable value, but if run it will output that value to the console.
- [gcode_macro ADD_VARIABLE]
- gcode:
- {% set MY_VARIABLE = printer["gcode_macro gcode_variables"].my_variable %}
- {% set NEW_VARIABLE = MY_VARIABLE + 1 %}
- SET_GCODE_VARIABLE MACRO=gcode_variables VARIABLE=my_variable VALUE={NEW_VARIABLE}
- [gcode_macro GCODE_VARIABLES]
- variable_my_variable: 0
- gcode:
- {% set MY_VARIABLE = printer["gcode_macro gcode_variables"].my_variable %}
- M118 {MY_VARIABLE}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement