-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdisplay.cfg
288 lines (247 loc) · 8.39 KB
/
display.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
#####################################################################
# Display
#####################################################################
## Fysetc Mini 12864 Display (V2.1)
## https://wiki.fysetc.com/Mini12864_Panel/
[display]
lcd_type: uc1701
cs_pin: EXP1_3
a0_pin: EXP1_4
encoder_pins: ^EXP2_3,^EXP2_5
click_pin: ^!EXP1_2
spi_bus: spi1
contrast: 63
display_group: __voron_display
## Neopixel interface on Mini 12864 Display
[neopixel neo_display]
pin: EXP1_6
chain_count: 3
initial_RED: 0.1
initial_GREEN: 0.5
initial_BLUE: 0.0
color_order: RGB
[output_pin _BEEPER]
pin: EXP1_1
pwm: true
value: 0
shutdown_value: 0
cycle_time: 0.01
#####################################################################
# Custom Glyph Definitions
#####################################################################
[display_glyph chamber]
data:
................
****************
*....*....*....*
*....*....*....*
*....******....*
*..............*
*..............*
*.....****.....*
*.***.*..*.***.*
*.....****.....*
*......**......*
*..............*
*.************.*
*...*......*...*
****************
................
[display_glyph thermometer]
data:
0000000000000000
0000000000000000
0000000000111000
0000000001000100
0000000010010100
0000000100100100
0000001001001000
0000010010010000
0001100100100000
0010001001000000
0100100010000000
0101110100000000
0100100100000000
0010001000000000
0001110000000000
0000000000000000
[display_glyph voron]
data:
......***.......
....*******.....
...*********....
.*************..
*****..***..***.
****..***..****.
***..***..*****.
**..***..******.
******..***..**.
*****..***..***.
****..***..****.
***..***..*****.
.*************..
...*********....
....*******.....
......***.......
#####################################################################
# Display Template/Definition
#####################################################################
[display_template _chamber_temperature]
text:
{% set chamber = printer['temperature_sensor chamber'] %}
~chamber~
{ "%3.0f" % (chamber.temperature,) }
~degrees~
[display_template _vprint_status]
text:
{% if printer.display_status.message %}
{ printer.display_status.message }
{% elif printer.idle_timeout.printing_time %}
{% set pos = printer.toolhead.position %}
{ "X%-4.0fY%-4.0fZ%-5.2f" % (pos.x, pos.y, pos.z) }
{% else %}
~voron~
{" V2.823"}
{% endif %}
[display_data __voron_display extruder]
position: 0, 0
text: { render("_heater_temperature", param_heater_name= printer.toolhead.extruder) }
[display_data __voron_display fan]
position: 0, 10
text:{ render("_fan_speed") }
[display_data __voron_display heater_bed]
position: 1, 0
text: { render("_heater_temperature", param_heater_name="heater_bed") }
[display_data __voron_display chamber]
position: 1, 10
text: { render("_chamber_temperature") }
[display_data __voron_display print_progress]
position: 2, 0
text: { "{:^10.0%}".format(printer.display_status.progress) }
[display_data __voron_display progress_bar]
position: 2, 1 # Draw graphical progress bar after text is written
text: { draw_progress_bar(2, 0, 10, printer.display_status.progress) }
[display_data __voron_display printing_time]
position: 2, 10
text: { "%6s" % (render("_printing_time").strip(),) }
[display_data __voron_display print_status]
position: 3, 0
text : { render("_vprint_status") }
#####################################################################
# Display Specific Macros
#####################################################################
## Audible Beep
# Volume can be adjusted with VALUE. Maximum volume is VALUE=0.5 on the 12864.
[gcode_macro M300]
default_parameter_S: 1000
default_parameter_P: 100
gcode:
{% if S|float != 0 %}
SET_PIN PIN=_BEEPER VALUE=0.5 CYCLE_TIME={1/S|float}
{% endif %}
G4 P{P}
SET_PIN PIN=_BEEPER VALUE=0
## Clear display after Duration
[delayed_gcode _CLEAR_DISPLAY]
gcode:
M117
[delayed_gcode _LCD_INIT_KNOB]
initial_duration: 1
gcode:
_LCD_KNOB COLOR=RED
[delayed_gcode _LCD_INIT_OFF]
initial_duration: 10
gcode:
SET_GCODE_VARIABLE MACRO=DISPLAY VARIABLE=state VALUE='"off"'
SET_LED LED=neo_display RED=0 GREEN=0 BLUE=0 INDEX=1 TRANSMIT=1
[gcode_macro _LCD_KNOB]
default_parameter_BLINK: 0
variable_color: 'GREEN'
variable_restore: 'GREEN'
variable_index: 2
variable_blink: 0
gcode:
{% set var_color=printer["gcode_macro _LCD_KNOB"].color %}
{% set var_restore=printer["gcode_macro _LCD_KNOB"].restore %}
SET_GCODE_VARIABLE MACRO=_LCD_KNOB VARIABLE=blink VALUE={BLINK}
UPDATE_DELAYED_GCODE ID=_BLINK_DELAY DURATION={BLINK|float}
SET_GCODE_VARIABLE MACRO=_LCD_KNOB VARIABLE=restore VALUE='"{var_color}"'
{% if params.COLOR == 'GREEN'%}
SET_GCODE_VARIABLE MACRO=_LCD_KNOB VARIABLE=color VALUE='"GREEN"'
SET_LED LED=neo_display RED=0 GREEN=0.3 BLUE=0 INDEX=2 TRANSMIT=0
SET_LED LED=neo_display RED=0 GREEN=0.3 BLUE=0 INDEX=3 TRANSMIT=1
{% elif params.COLOR == 'RED'%}
SET_GCODE_VARIABLE MACRO=_LCD_KNOB VARIABLE=color VALUE='"RED"'
SET_LED LED=neo_display RED=0.5 GREEN=0 BLUE=0 INDEX=2 TRANSMIT=0
SET_LED LED=neo_display RED=0.5 GREEN=0 BLUE=0 INDEX=3 TRANSMIT=1
{% elif params.COLOR == 'BLUE'%}
SET_GCODE_VARIABLE MACRO=_LCD_KNOB VARIABLE=color VALUE='"BLUE"'
SET_LED LED=neo_display RED=0 GREEN=0 BLUE=0.5 INDEX=2 TRANSMIT=0
SET_LED LED=neo_display RED=0 GREEN=0 BLUE=0.5 INDEX=3 TRANSMIT=1
{% else %}
{% if var_restore == 'GREEN'%}
SET_GCODE_VARIABLE MACRO=_LCD_KNOB VARIABLE=color VALUE='"GREEN"'
SET_LED LED=neo_display RED=0 GREEN=0.3 BLUE=0 INDEX=2 TRANSMIT=0
SET_LED LED=neo_display RED=0 GREEN=0.3 BLUE=0 INDEX=3 TRANSMIT=1
{% elif var_restore == 'RED'%}
SET_GCODE_VARIABLE MACRO=_LCD_KNOB VARIABLE=color VALUE='"RED"'
SET_LED LED=neo_display RED=0.5 GREEN=0 BLUE=0 INDEX=2 TRANSMIT=0
SET_LED LED=neo_display RED=0.5 GREEN=0 BLUE=0 INDEX=3 TRANSMIT=1
{% elif var_restore == 'BLUE'%}
SET_GCODE_VARIABLE MACRO=_LCD_KNOB VARIABLE=color VALUE='"BLUE"'
SET_LED LED=neo_display RED=0 GREEN=0 BLUE=0.5 INDEX=2 TRANSMIT=0
SET_LED LED=neo_display RED=0 GREEN=0 BLUE=0.5 INDEX=3 TRANSMIT=1
{% endif %}
{% endif %}
[delayed_gcode _BLINK_DELAY]
gcode:
{% set var_color=printer["gcode_macro _LCD_KNOB"].color %}
{% if printer["gcode_macro _LCD_KNOB"].index|int == 2 %}
SET_GCODE_VARIABLE MACRO=_LCD_KNOB VARIABLE=index VALUE=3
{% if var_color == 'GREEN'%}
SET_LED LED=neo_display RED=0.0 GREEN=0.3 BLUE=0.0 INDEX=2 TRANSMIT=0
SET_LED LED=neo_display RED=0.0 GREEN=0.0 BLUE=0.0 INDEX=3 TRANSMIT=1
{% elif var_color == 'RED'%}
SET_LED LED=neo_display RED=0.5 GREEN=0.0 BLUE=0.0 INDEX=2 TRANSMIT=0
SET_LED LED=neo_display RED=0.0 GREEN=0.0 BLUE=0.0 INDEX=3 TRANSMIT=1
{% elif var_color == 'BLUE'%}
SET_LED LED=neo_display RED=0.0 GREEN=0.0 BLUE=0.5 INDEX=2 TRANSMIT=0
SET_LED LED=neo_display RED=0.0 GREEN=0.0 BLUE=0.0 INDEX=3 TRANSMIT=1
{% endif %}
{% else %}
SET_GCODE_VARIABLE MACRO=_LCD_KNOB VARIABLE=index VALUE=2
{% if var_color == 'GREEN'%}
SET_LED LED=neo_display RED=0.0 GREEN=0.0 BLUE=0.0 INDEX=2 TRANSMIT=0
SET_LED LED=neo_display RED=0.0 GREEN=0.3 BLUE=0.0 INDEX=3 TRANSMIT=1
{% elif var_color == 'RED'%}
SET_LED LED=neo_display RED=0.0 GREEN=0.0 BLUE=0.0 INDEX=2 TRANSMIT=0
SET_LED LED=neo_display RED=0.5 GREEN=0.0 BLUE=0.0 INDEX=3 TRANSMIT=1
{% elif var_color == 'BLUE'%}
SET_LED LED=neo_display RED=0.0 GREEN=0.0 BLUE=0.0 INDEX=2 TRANSMIT=0
SET_LED LED=neo_display RED=0.0 GREEN=0.0 BLUE=0.5 INDEX=3 TRANSMIT=1
{% endif %}
{% endif %}
UPDATE_DELAYED_GCODE ID=_BLINK_DELAY DURATION={printer["gcode_macro _LCD_KNOB"].blink|float}
[gcode_macro DISPLAY]
variable_state: 'on'
gcode:
{% if printer["gcode_macro DISPLAY"].state == 'on' %}
_DISPLAY_OFF
{% else %}
_DISPLAY_ON
{% endif %}
[gcode_macro _display_state]
gcode:
{action_respond_info("LCD display %s" % (printer["gcode_macro DISPLAY"].state))}
[gcode_macro _DISPLAY_OFF]
## Display off to hinder burn in
gcode:
SET_GCODE_VARIABLE MACRO=DISPLAY VARIABLE=state VALUE='"off"'
SET_LED LED=neo_display RED=0 GREEN=0 BLUE=0 INDEX=1 TRANSMIT=1
_display_state
[gcode_macro _DISPLAY_ON]
## Display on
gcode:
SET_GCODE_VARIABLE MACRO=DISPLAY VARIABLE=state VALUE='"on"'
SET_LED LED=neo_display RED=0.8 GREEN=0.8 BLUE=1.0 INDEX=1 TRANSMIT=1
_display_state