Pulling in structure from personal branch.

This commit is contained in:
Bassam Husain
2023-03-14 18:36:53 -04:00
parent 07b3631512
commit 64a6f98fe4
3 changed files with 48 additions and 57 deletions

View File

@@ -210,4 +210,19 @@ gcode:
gcode:
{% if "xyz" not in printer.toolhead.homed_axes %}
G28
{% endif %}
{% endif %}
[gcode_macro BEEP]
description: BEEP I=3 DUR=200 FREQ=2000: Beep 3 times, for 200ms each, at 2kHz frequency.
gcode:
# Parameters
{% set i = params.I|default(1)|int %} ; Iterations (number of times to beep).
{% set dur = params.DUR|default(100)|int %} ; Duration/wait of each beep in ms. Default 100ms.
{% set freq = params.FREQ|default(2000)|int %} ; Frequency in Hz. Default 2kHz.
{% for iteration in range(i|int) %}
SET_PIN PIN=beeper VALUE=0.8 CYCLE_TIME={ 1.0/freq if freq > 0 else 1 }
G4 P{dur}
SET_PIN PIN=beeper VALUE=0
G4 P{dur}
{% endfor %}