Skip to content

Commit

Permalink
beep: Fix issue jschuh#24
Browse files Browse the repository at this point in the history
  • Loading branch information
jschuh committed Dec 10, 2022
1 parent d500b10 commit 03dde47
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions beep.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ description: Emits and audible beep.
gcode:
{% set km = printer["gcode_macro _km_globals"] %}
{% if "output_pin beeper" in printer %}
{% set P = params.P|default(km.beep_duration) %}
{% set S = params.S|default(km.beep_frequency) %}
SET_PIN PIN=beeper VALUE={S}
{% set P = (params.P|default(km.beep_duration)|int, 0)|max %}
{% set S = (params.S|default(km.beep_frequency)|int, 1)|max %}
SET_PIN PIN=beeper VALUE={
printer.configfile.settings["output_pin beeper"].scale * 0.5
} CYCLE_TIME={ 1.0 / S }
G4 P{P}
SET_PIN PIN=beeper VALUE=0
{% else %}
Expand Down

0 comments on commit 03dde47

Please sign in to comment.