-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtool_head_leds.cfg
163 lines (139 loc) · 5.89 KB
/
tool_head_leds.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# Setting based on voron.
# Thank you voron for contributing to the moment 3D printer.
#####################################################################
# LED Configuration
#####################################################################
[neopixel Toolhead_LED]
pin: EBBCan: PD3
chain_count: 2
color_order: GRBW, GRBW
initial_RED: 0.5
initial_GREEN: 0.5
initial_BLUE: 0.5
initial_WHITE: 1.0
[gcode_macro _toolhead_vars]
variable_colors: {
'logo': {
'busy': {'r': 0.4, 'g': 0.0, 'b': 0.0, 'w': 0.0},
'calibrating_z': {'r': 0.2, 'g': 1.0, 'b': 0.0, 'w': 0.0},
'heating': {'r': 1.0, 'g': 0.0, 'b': 0.0, 'w': 0.0},
'homing': {'r': 0.0, 'g': 0.6, 'b': 0.2, 'w': 0.0},
'leveling': {'r': 0.5, 'g': 0.1, 'b': 0.4, 'w': 0.0},
'meshing': {'r': 0.8, 'g': 0.0, 'b': 0.35, 'w': 0.0},
'off': {'r': 0.0, 'g': 0.0, 'b': 0.0, 'w': 0.0},
'printing': {'r': 1.0, 'g': 0.0, 'b': 0.0, 'w': 0.0},
'standby': {'r': 0.5, 'g': 0.5, 'b': 0.5, 'w': 0.1},
'load_unload': {'r': 1.0, 'g': 1.0, 'b': 0.0, 'w':0.0},
},
'nozzle': {
'heating': {'r': 1.0, 'g': 0.0, 'b': 0.0, 'w':0.0},
'off': {'r': 0.0, 'g': 0.0, 'b': 0.0, 'w': 0.0},
'on': {'r': 0.5, 'g': 0.5, 'b': 0.5, 'w':1.0},
'standby': {'r': 0.5, 'g': 0.5, 'b': 0.5, 'w':0.5},
'printing': {'r': 0.5, 'g': 0.5, 'b': 0.5, 'w':1.0},
'load_unload': {'r': 1.0, 'g': 1.0, 'b': 0.0, 'w':0.0},
},
'thermal': {
'hot': {'r': 1.0, 'g': 0.0, 'b': 0.0, 'w': 0.0},
'cold': {'r': 0.3, 'g': 0.0, 'b': 0.3, 'w': 0.0}
}
}
variable_logo_led_name: "Toolhead_LED"
variable_logo_idx: "1"
variable_nozzle_led_name: "Toolhead_LED"
variable_nozzle_idx: "2"
gcode:
[gcode_macro _set_toolhead_leds]
gcode:
{% set red = params.RED|default(0)|float %}
{% set green = params.GREEN|default(0)|float %}
{% set blue = params.BLUE|default(0)|float %}
{% set white = params.WHITE|default(0)|float %}
{% set led = params.LED|string %}
{% set idx = (params.IDX|string).split(',') %}
{% set transmit_last = params.TRANSMIT|default(1) %}
{% for led_index in idx %}
{% set transmit=transmit_last if loop.last else 0 %}
set_led led={led} red={red} green={green} blue={blue} white={white} index={led_index} transmit={transmit}
{% endfor %}
[gcode_macro _set_toolhead_leds_by_name]
gcode:
{% set leds_name = params.LEDS %}
{% set color_name = params.COLOR %}
{% set color = printer["gcode_macro _toolhead_vars"].colors[leds_name][color_name] %}
{% set led = printer["gcode_macro _toolhead_vars"][leds_name + "_led_name"] %}
{% set idx = printer["gcode_macro _toolhead_vars"][leds_name + "_idx"] %}
{% set transmit = params.TRANSMIT|default(1) %}
_set_toolhead_leds led={led} red={color.r} green={color.g} blue={color.b} white={color.w} idx="{idx}" transmit={transmit}
[gcode_macro _set_logo_leds]
gcode:
{% set red = params.RED|default(0)|float %}
{% set green = params.GREEN|default(0)|float %}
{% set blue = params.BLUE|default(0)|float %}
{% set white = params.WHITE|default(0)|float %}
{% set led = printer["gcode_macro _toolhead_vars"].logo_led_name %}
{% set idx = printer["gcode_macro _toolhead_vars"].logo_idx %}
{% set transmit=params.TRANSMIT|default(1) %}
_set_toolhead_leds led={led} red={red} green={green} blue={blue} white={white} idx="{idx}" transmit={transmit}
[gcode_macro _set_nozzle_leds]
gcode:
{% set red = params.RED|default(0)|float %}
{% set green = params.GREEN|default(0)|float %}
{% set blue = params.BLUE|default(0)|float %}
{% set white = params.WHITE|default(0)|float %}
{% set led = printer["gcode_macro _toolhead_vars"].nozzle_led_name %}
{% set idx = printer["gcode_macro _toolhead_vars"].nozzle_idx %}
{% set transmit=params.TRANSMIT|default(1) %}
_set_toolhead_leds led={led} red={red} green={green} blue={blue} white={white} idx="{idx}" transmit={transmit}
[gcode_macro set_logo_leds_off]
gcode:
{% set transmit=params.TRANSMIT|default(1) %}
_set_logo_leds red=0 blue=0 green=0 white=0 transmit={transmit}
[gcode_macro set_nozzle_leds_on]
gcode:
{% set transmit=params.TRANSMIT|default(1) %}
_set_toolhead_leds_by_name leds="nozzle" color="on" transmit={transmit}
[gcode_macro set_nozzle_leds_off]
gcode:
{% set transmit=params.TRANSMIT|default(1) %}
_set_toolhead_leds_by_name leds="nozzle" color="off" transmit={transmit}
[gcode_macro status_off]
gcode:
set_logo_leds_off transmit=0
set_nozzle_leds_off
[gcode_macro status_ready]
gcode:
_set_toolhead_leds_by_name leds="logo" color="standby" transmit=0
_set_toolhead_leds_by_name leds="nozzle" color="standby" transmit=1
[gcode_macro status_busy]
gcode:
_set_toolhead_leds_by_name leds="logo" color="busy" transmit=0
set_nozzle_leds_on
[gcode_macro status_heating]
gcode:
_set_toolhead_leds_by_name leds="logo" color="heating" transmit=0
_set_toolhead_leds_by_name leds="nozzle" color="heating" transmit=1
[gcode_macro status_leveling]
gcode:
_set_toolhead_leds_by_name leds="logo" color="leveling" transmit=0
set_nozzle_leds_on
[gcode_macro status_homing]
gcode:
_set_toolhead_leds_by_name leds="logo" color="homing" transmit=0
set_nozzle_leds_on
[gcode_macro status_meshing]
gcode:
_set_toolhead_leds_by_name leds="logo" color="meshing" transmit=0
set_nozzle_leds_on
[gcode_macro status_calibrating_z]
gcode:
_set_toolhead_leds_by_name leds="logo" color="calibrating_z" transmit=0
set_nozzle_leds_on
[gcode_macro status_printing]
gcode:
_set_toolhead_leds_by_name leds="logo" color="printing" transmit=0
set_nozzle_leds_on
[gcode_macro status_load_unload]
gcode:
_set_toolhead_leds_by_name leds="logo" color="load_unload" transmit=0
_set_toolhead_leds_by_name leds="nozzle" color="load_unload" transmit=1