diff --git a/config/sample-macros.cfg b/config/sample-macros.cfg index 1f6d84a1..44b8648c 100644 --- a/config/sample-macros.cfg +++ b/config/sample-macros.cfg @@ -1,57 +1,70 @@ # This file provides examples of Klipper G-Code macros. The snippets -# in this file may be copied into the main printer.cfg file. +# in this file may be copied into the main printer.cfg file and +# customized. # # See the "example.cfg" file for description of common config parameters. -# M300 : Play tone, Beeper support, as commonly found on usual LCD displays -# i.e. RepRapDiscount 2004 Smart Controller, RepRapDiscount 12864 Full Graphic -# This defines a custom I/O pin and a custom GCODE macro -# Usage: M300 [P] [S] P is the tone duration, S the tone frequency. -# as it is based on a PWM duty cycle, the frequency won't be pitch perfect. -# -#[output_pin BEEPER_pin] -#pin: ar37 +###################################################################### +# Beeper +###################################################################### + +# M300 : Play tone. Beeper support, as commonly found on usual LCD +# displays (i.e. RepRapDiscount 2004 Smart Controller, RepRapDiscount +# 12864 Full Graphic). This defines a custom I/O pin and a custom +# GCODE macro. Usage: +# M300 [P] [S] +# P is the tone duration, S the tone frequency. +# The frequency won't be pitch perfect. + +[output_pin BEEPER_pin] +pin: ar37 # Beeper pin. This parameter must be provided. # ar37 is the default RAMPS/MKS pin. -#pwm: True +pwm: True # A piezo beeper needs a PWM signal, a DC buzzer doesn't. -#value: 0 +value: 0 # Silent at power on, set to 1 if active low. -#shutdown_value: 0 +shutdown_value: 0 # Disable at emergency shutdown (no PWM would be available anyway). -#cycle_time: 0.001 +cycle_time: 0.001 # PWM frequency : 0.001 = 1ms will give a base tone of 1kHz -#scale: 1000 +scale: 1000 # PWM parameter will be in the range of (0-1000 Hz). # Although not pitch perfect. -# -#[gcode_macro M300] -#default_parameter_S=1000 -# Allows for a default 1kHz tone if S is omitted -#default_parameter_P=100 -# Allows for a default 10ms duration is P is omitted -#gcode: SET_PIN PIN=BEEPER_pin VALUE={S} -# G4 P{P} -# SET_PIN PIN=BEEPER_pin VALUE=0 -# M600: Filament Change. This macro will pause the printer, move -# the tool to the change position, and retract the filament 50mm. -# Adjust the retraction settings for your own extruder. After filament -# has been changed, the print can be resumed from its previous position -# with the "RESUME" gcode -# -#[gcode_macro M600] -#default_parameter_X: 50 -#default_parameter_Y: 0 -#default_parameter_Z: 10 -#gcode: -# PAUSE -# G91 -# G1 E-.8 F2700 -# G1 Z{Z} -# G90 -# G1 X{X} Y{Y} F3000 -# G91 -# G1 E-50 F1000 -# G90 +[gcode_macro M300] +default_parameter_S: 1000 +# Use a default 1kHz tone if S is omitted. +default_parameter_P: 100 +# Use a 10ms duration is P is omitted. +gcode: + SET_PIN PIN=BEEPER_pin VALUE={S} + G4 P{P} + SET_PIN PIN=BEEPER_pin VALUE=0 + + +###################################################################### +# Filament Change +###################################################################### + +# M600: Filament Change. This macro will pause the printer, move the +# tool to the change position, and retract the filament 50mm. Adjust +# the retraction settings for your own extruder. After filament has +# been changed, the print can be resumed from its previous position +# with the "RESUME" gcode. + +[gcode_macro M600] +default_parameter_X: 50 +default_parameter_Y: 0 +default_parameter_Z: 10 +gcode: + PAUSE + G91 + G1 E-.8 F2700 + G1 Z{Z} + G90 + G1 X{X} Y{Y} F3000 + G91 + G1 E-50 F1000 + G90