-
Notifications
You must be signed in to change notification settings - Fork 0
/
sb_leds.cfg
390 lines (326 loc) · 10.8 KB
/
sb_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
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
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
# Macros for setting the status leds on the Voron StealthBurner toolhead (or for any neopixel-type leds).
#
# Use this file for the standard setup with one logo LED and two nozzle LEDs.
# Thank you to Urufu_Shinjiro and ChristianN for providing this file.
#
# You will need to configure a neopixel (or other addressable led, such as dotstar). See
# https://www.klipper3d.org/Config_Reference.html#neopixel for configuration details.
#####################################
# INSTRUCTIONS #
#####################################
# How to use all this stuff:
#
# 1. Copy this .cfg file into your Klipper config directory and then add [include stealthburner_leds.cfg]
# to the top of your printer.cfg in order for register the LEDs and macros with Klipper.
# 2. Define your LEDs by editing [neopixel sb_leds] below and entering the data pin from your control board
# as well as the color order.
#
# Note: RGB and RGBW are different and must be defined explicitly in the color order.
#
# RGBW LEDs will have a visible yellow-ish phosphor section to the chip. If your LEDs do not have
# this yellow portion, you have RGB LEDs.
#
# 3. Save your config and restart Klipper.
#
# Note: We set RED and BLUE to 1.0 to make it easier for users and supporters to detect
# misconfigurations or miswiring. The default color format is for Neopixels with a dedicated
# white LED. On startup, all three SB LEDs should light up.
#
# If you get random colors across your LEDs, change the color_order to GRB and restart. Then
# omit the W for each suggested color_order in the next paragraph.
#
# If you get MAGENTA, your color order is correct. If you get CYAN, you need to use RGBW. If
# you get YELLOW, you need to use BRGW (note that BRG is only supported in the latest Klipper
# version).
#
# 4. Once you have confirmed that the LEDs are set up correctly, you must now decide where you want
# these macros called up...which means adding them to your existing gcode macros. NOTHING will happen
# unless you add the STATUS_????? macros to your existing gcode macros.
#
# Example: add STATUS_LEVELING to the beginning of your QGL gcode macro, and then add STATUS_READY
# to the end of it to set the logo LED and nozzle LEDs back to the `ready` state.
#
# Example: add STATUS_CLEANING to the beginning of your nozzle-cleaning macro, and then STATUS_READY
# to the end of it to return the LEDs back to `ready` state.
#
# 5. Feel free to change colors of each macro, create new ones if you have a need to. The macros provided below
# are just an example of what is possible. If you want to try some more complex animations, you will most
# likely have to use WLED with Moonraker and a small micro-controller (please see the LED thread for help inside
# of the stealthburner_beta channel on Discord).
#
#####################################
# END INSTRUCTRUCTIONS #
#####################################
[neopixel sb_leds]
pin: ebb36:RGBLED
# The pin connected to the neopixel. This parameter must be
# provided.
chain_count: 3
# The number of Neopixel chips that are "daisy chained" to the
# provided pin. The default is 1 (which indicates only a single
# Neopixel is connected to the pin).
color_order: GRBW
# Set the pixel order required by the LED hardware. Options are GRB,
# RGB, GRBW, or RGBW. The default is GRB.
initial_RED: 0.0
initial_GREEN: 0.0
initial_BLUE: 0.0
initial_WHITE: 0.0
##########################
# LED Effects Animations #
##########################
##################
## logo effects ##
##################
[led_effect sb_logo_busy]
autostart: false
frame_rate: 24
leds:
neopixel:sb_leds (1)
layers:
breathing 3 1 top (1,0,0)
[led_effect sb_logo_cleaning]
autostart: false
frame_rate: 24
leds:
neopixel:sb_leds (1)
layers:
breathing 3 1 top (0.0, 0.02, 0.5)
[led_effect sb_logo_calibrating_z]
autostart: false
frame_rate: 24
leds:
neopixel:sb_leds (1)
layers:
breathing 3 1 top (0.0, 0.0, 0.35)
endstops: z,probe
[led_effect sb_logo_heating]
leds:
neopixel:sb_leds (1)
autostart: false
frame_rate: 24
layers:
breathing 3 1 top (1, 0.18, 0)
[led_effect sb_logo_cooling]
leds:
neopixel:sb_leds (1)
autostart: false
frame_rate: 24
layers:
breathing 3 1 top (0, 0, 1)
[led_effect sb_logo_homing]
autostart: false
frame_rate: 24
leds:
neopixel:sb_leds (1)
layers:
homing 3 1 add (0.0, 0.0, 1.0, 0.0)
static 1 1 top (0.0, 0.0, 0.1, 0.0)
endstops: x,y,z,probe
[led_effect sb_logo_leveling]
autostart: false
frame_rate: 24
leds:
neopixel:sb_leds (1)
layers:
breathing 3 1 top (0.5, 0.1, 0.4)
endstops: z,probe
[led_effect sb_logo_meshing]
autostart: false
frame_rate: 24
leds:
neopixel:sb_leds (1)
layers:
breathing 3 1 top (0.2, 1.0, 0.0)
endstops: z,probe
[led_effect sb_logo_printing]
autostart: false
frame_rate: 24
leds:
neopixel:sb_leds (1)
layers:
# gradient 0.3 1 add (0.3, 0.0, 0.0),(0.3, 0.3, 0.0),(0.3, 0.1, 0.0)
gradient 0.3 1 add (0.8, 1.0, 1.0),(0.0, 0.8, 1.0),(0.0, 0.0, 1.0)
[led_effect sb_logo_standby]
autostart: false
frame_rate: 24
leds:
neopixel:sb_leds (1)
layers:
breathing 3 1 top (0.01, 0.01, 0.01)
[led_effect sb_logo_part_ready]
autostart: false
frame_rate: 24
leds:
neopixel:sb_leds (1)
layers:
breathing 3 1 top (0.0, 1.0, 0.0)
####################
## nozzle effects ##
####################
[led_effect sb_nozzle_heating]
autostart: false
frame_rate: 24
leds:
neopixel:sb_leds (2,3)
layers:
breathing 3 1 top (1.0, 0.18, 0.0, 0.0)
[led_effect sb_nozzle_cooling]
autostart: false
frame_rate: 24
leds:
neopixel:sb_leds (2,3)
layers:
breathing 3 1 top (0.0, 0.0, 1.0, 0.1)
[led_effect sb_nozzle_standby]
autostart: false
frame_rate: 24
leds:
neopixel:sb_leds (2,3)
layers:
breathing 3 1 top (0.6, 0.0, 0.0, 0.0)
[led_effect sb_nozzle_part_ready]
autostart: false
frame_rate: 24
leds:
neopixel:sb_leds (2,3)
layers:
breathing 3 1 top (0.6, 1.0, 0.0, 0.1)
#####################
## all led effects ##
#####################
[led_effect sb_critical_error]
leds:
neopixel:sb_leds
layers:
strobe 1 1.5 add (1.0, 1.0, 1.0)
breathing 2 0 difference (0.95, 0.0, 0.0)
static 1 0 top (1.0, 0.0, 0.0)
autostart: false
frame_rate: 24
run_on_error: true
[led_effect rainbow]
leds:
neopixel:sb_leds
autostart: false
frame_rate: 24
layers:
gradient 0.3 1 add (0.3, 0.0, 0.0),(0.0, 0.3, 0.0),(0.0, 0.0, 0.3)
#######################
# LED Effects Statics #
#######################
[led_effect set_nozzle_leds]
leds:
neopixel:sb_leds (2,3)
#neopixel:caselight
autostart: false
frame_rate: 24
layers:
static 0 0 top (0.0, 0.0, 0.0, 1.0)
[led_effect set_logo_leds]
leds:
neopixel:sb_leds (1)
autostart: false
frame_rate: 24
layers:
static 0 0 top (1.0, 1.0, 1.0)
##############
# The Macros #
##############
[gcode_macro set_logo_leds_off]
gcode:
SET_LED_EFFECT EFFECT=set_logo_leds STOP=1
[gcode_macro set_logo_leds_on]
gcode:
SET_LED_EFFECT EFFECT=set_logo_leds
[gcode_macro set_nozzle_leds_on]
gcode:
SET_LED_EFFECT EFFECT=set_nozzle_leds
[gcode_macro set_nozzle_leds_off]
gcode:
SET_LED_EFFECT EFFECT=set_nozzle_leds STOP=1
[gcode_macro status_off]
gcode:
STOP_LED_EFFECTS
[gcode_macro status_ready]
gcode:
STOP_LED_EFFECTS
SET_LED_EFFECT EFFECT=rainbow
[gcode_macro status_part_ready]
gcode:
STOP_LED_EFFECTS
SET_LED_EFFECT EFFECT=sb_nozzle_part_ready
SET_LED_EFFECT EFFECT=sb_logo_part_ready
[gcode_macro status_busy]
gcode:
STOP_LED_EFFECTS
SET_LED_EFFECT EFFECT=sb_logo_busy
set_nozzle_leds_on
[gcode_macro status_heating]
gcode:
STOP_LED_EFFECTS
SET_LED_EFFECT EFFECT=sb_logo_heating
SET_LED_EFFECT EFFECT=sb_nozzle_heating
[gcode_macro status_cooling]
gcode:
STOP_LED_EFFECTS
SET_LED_EFFECT EFFECT=sb_logo_cooling
SET_LED_EFFECT EFFECT=sb_nozzle_cooling
[gcode_macro status_leveling]
gcode:
STOP_LED_EFFECTS
SET_LED_EFFECT EFFECT=sb_logo_leveling
set_nozzle_leds_on
[gcode_macro status_homing]
gcode:
STOP_LED_EFFECTS
SET_LED_EFFECT EFFECT=sb_logo_homing
#set_nozzle_leds_on
[gcode_macro status_cleaning]
gcode:
STOP_LED_EFFECTS
SET_LED_EFFECT EFFECT=sb_logo_cleaning
set_nozzle_leds_on
[gcode_macro status_meshing]
gcode:
STOP_LED_EFFECTS
SET_LED_EFFECT EFFECT=sb_logo_meshing
set_nozzle_leds_on
[gcode_macro status_calibrating_z]
gcode:
STOP_LED_EFFECTS
SET_LED_EFFECT EFFECT=sb_logo_calibrating_z
set_nozzle_leds_on
[gcode_macro status_printing]
gcode:
STOP_LED_EFFECTS
SET_LED_EFFECT EFFECT=sb_logo_printing
set_nozzle_leds_on
[gcode_macro fluorescent_striking]
gcode:
{% set LEDTimes = [10, 20, 20, 240, 20, 40, 20, 100, 20, 20, 20, 260, 80, 20, 240, 60, 160, 20, 240, 20, 1000, 20, 20, 40, 100, 20, 274, 340, 860, 20, 1400, 20, 60, 20] %}
{% set RGB_Red = 0.0 %}
{% set RGB_Green = 0.0 %}
{% set RGB_Blue = 0.2 %}
{% set RGB_White = 0.2 %}
{% set RGB_Strip = "sb_leds" %}
{% for toggletime in LEDTimes %}
{% set ledTime = toggletime|string %}
{% set loopCount = loop.index %}
{% if loopCount is divisibleby 2 %} # If the loop index is divisible by 2 (firtst index is NOT so the LEd should turn ON)
SET_LED LED={RGB_Strip} BLUE={RGB_Blue} INDEX=1 Transmit=0
SET_LED LED={RGB_Strip} WHITE={RGB_White} INDEX=2 Transmit=0
SET_LED LED={RGB_Strip} WHITE={RGB_White} INDEX=3 Transmit=1
G4 P{ledTime|int}
{% else %}
SET_LED LED={RGB_Strip}
G4 P{ledTime|int}
{% endif %}
{% endfor %}
{% for i in range(1,9) %} # loops 1,2,3,4,5
{action_respond_info(i|string)}
SET_LED LED={RGB_Strip} BLUE={RGB_Blue+(i/10)} INDEX=1 Transmit=0
SET_LED LED={RGB_Strip} WHITE={RGB_White+(i/10)} INDEX=2 Transmit=0
SET_LED LED={RGB_Strip} WHITE={RGB_White+(i/10)} INDEX=3 Transmit=1
G4 P200
{% endfor %}