mirror of
https://github.com/bassamanator/Sovol-SV06-firmware.git
synced 2025-11-09 14:01:17 +00:00
Added beep macro.
This commit is contained in:
21
macros/beeper.cfg
Normal file
21
macros/beeper.cfg
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
[output_pin beeper]
|
||||||
|
pin: PC6
|
||||||
|
value: 0
|
||||||
|
shutdown_value: 0
|
||||||
|
pwm: True
|
||||||
|
cycle_time: 0.0005 ; Default beeper tone in kHz. 1 / 0.0005 = 2000Hz (2kHz)
|
||||||
|
|
||||||
|
[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 %}
|
||||||
@@ -14,6 +14,7 @@
|
|||||||
[include ./macros/TEST_SPEED.cfg]
|
[include ./macros/TEST_SPEED.cfg]
|
||||||
[include ./macros/PARKING.cfg]
|
[include ./macros/PARKING.cfg]
|
||||||
[include ./macros/MECHANICAL_GANTRY_CALIBRATION.cfg]
|
[include ./macros/MECHANICAL_GANTRY_CALIBRATION.cfg]
|
||||||
|
[include ./macros/beeper.cfg]
|
||||||
# Uncomment the following line if you're using an adxl345, and have it setup
|
# Uncomment the following line if you're using an adxl345, and have it setup
|
||||||
# [include ./adxl-rp2040.cfg]
|
# [include ./adxl-rp2040.cfg]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user