G-code Digital Buttons (#18389)

Co-Authored-By: android444 <24375898+android444@users.noreply.github.com>
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
MoellerDi
2021-03-01 15:03:41 +01:00
committed by GitHub
parent 8c9a59c29e
commit 7ee9aefed7
3 changed files with 284 additions and 1 deletions

View File

@@ -3369,6 +3369,37 @@
#define GCODE_MACROS_SLOT_SIZE 50 // Maximum length of a single macro
#endif
/**
* User-defined buttons to run custom G-code.
* Up to 25 may be defined.
*/
//#define CUSTOM_USER_BUTTONS
#if ENABLED(CUSTOM_USER_BUTTONS)
//#define BUTTON1_PIN -1
#if PIN_EXISTS(BUTTON1_PIN)
#define BUTTON1_HIT_STATE LOW // State of the triggered button. NC=LOW. NO=HIGH.
#define BUTTON1_WHEN_PRINTING false // Button allowed to trigger during printing?
#define BUTTON1_GCODE "G28"
#define BUTTON1_DESC "Homing" // Optional string to set the LCD status
#endif
//#define BUTTON2_PIN -1
#if PIN_EXISTS(BUTTON2_PIN)
#define BUTTON2_HIT_STATE LOW
#define BUTTON2_WHEN_PRINTING false
#define BUTTON2_GCODE "M140 S" STRINGIFY(PREHEAT_1_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_1_TEMP_HOTEND)
#define BUTTON2_DESC "Preheat for " PREHEAT_1_LABEL
#endif
//#define BUTTON3_PIN -1
#if PIN_EXISTS(BUTTON3_PIN)
#define BUTTON3_HIT_STATE LOW
#define BUTTON3_WHEN_PRINTING false
#define BUTTON3_GCODE "M140 S" STRINGIFY(PREHEAT_2_TEMP_BED) "\nM104 S" STRINGIFY(PREHEAT_2_TEMP_HOTEND)
#define BUTTON3_DESC "Preheat for " PREHEAT_2_LABEL
#endif
#endif
/**
* User-defined menu items to run custom G-code.
* Up to 25 may be defined, but the actual number is LCD-dependent.