-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathfans.cfg
41 lines (38 loc) · 1.05 KB
/
fans.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#Since klipper currently doesn't have proper support for M106/M107
#we need to add a PWM output and write some gcode macros to fix it
[output_pin tool2_fan]
pin: PE5
pwm:true
[gcode_macro M106]
rename_existing: M106.1
gcode:
{% if 'S' in params %}
{% set S = params.S | int %}
{% else %}
{% set S = 255 %}
{% endif %}
{% if 'P' in params %}
{% set P = params.P |int %}
{% if P == 0 %}
M106.1 S{ S }
#If you need more fans copy the logic below for each additional fan.
{% elif P == 1 %}
SET_PIN PIN=tool2_fan VALUE={ S/255.0 }
{% endif %}
{% else %}
M106.1 S{ S }
{% endif %}
[gcode_macro M107]
rename_existing: M107.1
gcode:
{% if 'P' in params %}
{% set P = params.P |int %}
{% if P == 0 %}
M107.1
{% elif P == 1 %}
#If you need more fans copy the logic below for each additional fan.
SET_PIN PIN=tool2_fan VALUE=0
{% endif %}
{% else %}
M107.1
{% endif %}