-
Notifications
You must be signed in to change notification settings - Fork 0
/
neopixels.cfg
224 lines (171 loc) · 5.81 KB
/
neopixels.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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
[delayed_gcode ON_CONNECT]
initial_duration: 0.5
gcode:
SET_LED_TEMPLATE LED=RGB TEMPLATE=""
SET_LED LED=RGB RED=1.0 GREEN=1.0 BLUE=1.0
[gcode_macro NEOPIXEL_ON]
description: Turn On Neopixels LEDs
gcode:
SET_LED_TEMPLATE LED=RGB TEMPLATE=""
SET_LED LED=RGB RED=1.0 GREEN=1.0 BLUE=1.0
[gcode_macro NEOPIXEL_OFF]
description: Turn Off Neopixels LEDs
gcode:
SET_LED_TEMPLATE LED=RGB TEMPLATE=""
SET_LED LED=RGB RED=0.0 GREEN=0.0 BLUE=0.0
[gcode_macro NEOPIXEL_BLUE]
description: Turn On Neopixels LEDs in blue
gcode:
SET_LED_TEMPLATE LED=RGB TEMPLATE=""
SET_LED LED=RGB RED=0.0 GREEN=0.0 BLUE=1.0
[gcode_macro NEOPIXEL_RED]
description: Turn On Neopixels LEDs in red
gcode:
SET_LED_TEMPLATE LED=RGB TEMPLATE=""
SET_LED LED=RGB RED=1.0 GREEN=0.0 BLUE=0.0
[gcode_macro NEOPIXEL_GREEN]
description: Turn On Neopixels LEDs in green
gcode:
SET_LED_TEMPLATE LED=RGB TEMPLATE=""
SET_LED LED=RGB RED=0.0 GREEN=1.0 BLUE=0.0
[gcode_macro NEOPIXEL_YELLOW]
description: Turn On Neopixels LEDs in yellow
gcode:
SET_LED_TEMPLATE LED=RGB TEMPLATE=""
SET_LED LED=RGB RED=1.0 GREEN=1.0 BLUE=0.0
[gcode_macro NEOPIXEL_ORANGE]
description: Turn On Neopixels LEDs in orange
gcode:
SET_LED_TEMPLATE LED=RGB TEMPLATE=""
SET_LED LED=RGB RED=1.0 GREEN=0.31 BLUE=0.0
[gcode_macro NEOPIXEL_VIOLET]
description: Turn On Neopixels LEDs in violet
gcode:
SET_LED_TEMPLATE LED=RGB TEMPLATE=""
SET_LED LED=RGB RED=1.0 GREEN=0.0 BLUE=1.0
[gcode_macro HOTEND_GLOW]
description: Turn on LEDs based on nozzle temperature (All LEDs)
gcode:
NEOPIXEL_DISPLAY LED=RGB TYPE=extruder_temp MODE=glow
[gcode_macro HOTEND_PROGRESS]
description: Turn on LEDs based on nozzle temperature (LED by LED)
gcode:
NEOPIXEL_DISPLAY LED=RGB TYPE=extruder_temp MODE=progress
[gcode_macro BED_GLOW]
description: Turn on the LEDs based on bed temperature (All LEDs)
gcode:
NEOPIXEL_DISPLAY LED=RGB TYPE=bed_temp MODE=glow
[gcode_macro BED_PROGRESS]
description: Turn on the LEDs based on bed temperature (LED by LED)
gcode:
NEOPIXEL_DISPLAY LED=RGB TYPE=bed_temp MODE=progress
[gcode_macro PERCENT_GLOW]
description: Turn on LEDs based on printing progress (All LEDs)
gcode:
NEOPIXEL_DISPLAY LED=RGB TYPE=print_percent MODE=glow
[gcode_macro PERCENT_PROGRESS]
description: Turn on LEDs based on printing progress (LED by LED)
gcode:
NEOPIXEL_DISPLAY LED=RGB TYPE=print_percent MODE=progress
[gcode_macro SPEED_GLOW]
description: Turn on LEDs based on printing speed (All LEDs)
gcode:
NEOPIXEL_DISPLAY LED=RGB TYPE=printer_speed MODE=glow
[gcode_macro SPEED_PROGRESS]
description: Turn on LEDs based on printing speed (LED by LED)
gcode:
NEOPIXEL_DISPLAY LED=RGB TYPE=printer_speed MODE=progress
[gcode_macro NEOPIXEL_DISPLAY]
gcode:
{% set led = params.LED %}
{% set type = params.TYPE %}
{% set mode = params.MODE %}
{% set my_neopixel = printer.configfile.config['neopixel ' ~ led] %}
{% if mode == 'progress' %}
{% for i in range(my_neopixel.chain_count|int) %}
SET_LED_TEMPLATE LED={led} INDEX={i+1} TEMPLATE={'led_' ~ type ~ '_' ~ mode} param_led_num={i+1} param_led_total={my_neopixel.chain_count|int}
{% endfor %}
{% endif %}
{% if mode == 'glow' %}
SET_LED_TEMPLATE LED={led} TEMPLATE={'led_' ~ type ~ '_' ~ mode}
{% endif %}
[display_template led_extruder_temp_glow]
text:
{% if printer.extruder.target > 0.0 %}
{% set temp = printer.extruder.target %}
{% else %}
{% set temp = printer.configfile.config.extruder.max_temp %}
{% endif %}
{% set ratio = printer.extruder.temperature / temp|float %}
{ratio}, 0.0, {1-ratio}, 0.0
[display_template led_extruder_temp_progress]
param_led_num: 0
param_led_total: 1
text:
{% if printer.extruder.target > 0.0 %}
{% set temp = printer.extruder.target %}
{% else %}
{% set temp = printer.configfile.config.extruder.max_temp %}
{% endif %}
{% set ratio = printer.extruder.temperature / temp|float %}
{% set led_ratio = param_led_num|float / param_led_total %}
{% if ratio > led_ratio %}
{led_ratio}, 0.0, 0.0, 0.0
{% else %}
0.0, 0.0, 0.0, 0.0
{% endif %}
[display_template led_bed_temp_glow]
text:
{% if printer.heater_bed.target > 0.0 %}
{% set temp = printer.heater_bed.target %}
{% else %}
{% set temp = printer.configfile.config.heater_bed.max_temp %}
{% endif %}
{% set ratio = printer.heater_bed.temperature / temp|float %}
{ratio}, 0.0, {1-ratio}, 0.0
[display_template led_bed_temp_progress]
param_led_num: 0
param_led_total: 1
text:
{% if printer.heater_bed.target > 0.0 %}
{% set temp = printer.heater_bed.target %}
{% else %}
{% set temp = printer.configfile.config.heater_bed.max_temp %}
{% endif %}
{% set ratio = printer.heater_bed.temperature / temp|float %}
{% set led_ratio = param_led_num|float / param_led_total %}
{% if ratio > led_ratio %}
{led_ratio}, 0.0, 0.0, 0.0
{% else %}
0.0, 0.0, 0.0, 0.0
{% endif %}
[display_template led_print_percent_glow]
text:
{% set ratio = printer.virtual_sdcard.progress %}
0.0, {ratio}, 0.0, 0.0
[display_template led_print_percent_progress]
param_led_num: 0
param_led_total: 1
text:
{% set ratio = printer.virtual_sdcard.progress %}
{% set led_ratio = param_led_num|float / param_led_total %}
{% if ratio > led_ratio %}
0.0, {led_ratio}, 0.0, 0.0
{% else %}
0.0, 0.0, 0.0, 0.0
{% endif %}
[display_template led_printer_speed_glow]
text:
{% set ratio = printer.motion_report.live_velocity|float / printer.configfile.config.printer.max_velocity|float %}
0.0, {ratio}, 0.0, 0.0
[display_template led_printer_speed_progress]
param_led_num: 0
param_led_total: 1
text:
{% set ratio = printer.motion_report.live_velocity|float / printer.configfile.config.printer.max_velocity|float %}
{% set led_ratio = param_led_num|float / param_led_total %}
{% if ratio > led_ratio %}
0.0, {led_ratio}, 0.0, 0.0
{% else %}
0.0, 0.0, 0.0, 0.0
{% endif %}