gcode_button: Execute gcode when a button is pressed or released (#1745)

An extra to execute gcode when a hardware button is pressed or released. Uses the jinja2 templating system.

Inspired by pull request #545 from Miguel Moitinho miguel@moitinho.net and pull request #1098 from Paulo Drugos paulodrugos@gmail.com

Signed-off-by: Alec Plumb <alec@etherwalker.com>
This commit is contained in:
Alec B. Plumb
2019-06-21 15:06:31 -07:00
committed by KevinOConnor
parent 83e6c01ada
commit daadb36cb4
2 changed files with 76 additions and 0 deletions

View File

@@ -1618,3 +1618,18 @@
# Replicape support - see the generic-replicape.cfg file for further
# details.
#[replicape]
# Execute gcode when a button is pressed or released (or when a pin changes
# state). You can check the state of the button my using
# QUERY_BUTTON button=my_gcode_button
#[gcode_button my_gcode_button]
#pin:
# The pin on which the button is connected. This parameter must be
# provided.
#press_gcode:
# A list of G-Code commands to execute when the button is pressed.
# G-Code templates are supported.
#release_gcode:
# A list of G-Code commands to execute when the button is released.
# G-Code templates are supported.