diff options
author | ndupont-net <44698519+ndupont-net@users.noreply.github.com> | 2018-11-08 14:12:07 +0100 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2018-11-13 12:42:10 -0500 |
commit | ccb660a0ea373e85b5d2ae70d7cf4324a4bf5575 (patch) | |
tree | cd684e7b6bf497a519c6571a911f2003ac707028 /config | |
parent | 22f7be8b74f4c702f78edc36aef71cca32d216ba (diff) | |
download | kutter-ccb660a0ea373e85b5d2ae70d7cf4324a4bf5575.tar.gz kutter-ccb660a0ea373e85b5d2ae70d7cf4324a4bf5575.tar.xz kutter-ccb660a0ea373e85b5d2ae70d7cf4324a4bf5575.zip |
config: sample-macros.cfg creation and M300
Implementation of M300 "Play Tone"
Signed-off-by: Nicolas Dupont <ndupont@ndupont.net>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'config')
-rw-r--r-- | config/sample-macros.cfg | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/config/sample-macros.cfg b/config/sample-macros.cfg new file mode 100644 index 00000000..10854b58 --- /dev/null +++ b/config/sample-macros.cfg @@ -0,0 +1,36 @@ +# This file provides examples of Klipper G-Code macros. The snippets +# in this file may be copied into the main printer.cfg file. +# +# 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<ms>] [S<Hz>] 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 pin. This parameter must be provided. +# ar37 is the default RAMPS/MKS pin. +#pwm: True +# A piezo beeper needs a PWM signal, a DC buzzer doesn't. +#value: 0 +# Silent at power on, set to 1 if active low. +#shutdown_value: 0 +# Disable at emergency shutdown (no PWM would be available anyway). +#cycle_time: 0.001 +# PWM frequency : 0.001 = 1ms will give a base tone of 1kHz +#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 |