Ender 3 - Klipper Firmware
This commit is contained in:
117
creality-ender3/Klipper/config/led-progress.cfg
Normal file
117
creality-ender3/Klipper/config/led-progress.cfg
Normal file
@@ -0,0 +1,117 @@
|
||||
# use NEOPIXEL_DISPLAY LED=Led_Name TYPE=template_type MODE=template_mode
|
||||
|
||||
# for TYPE use:
|
||||
# extruder_temp :extruder temperature progress
|
||||
# bed_temp :bed temperature progress
|
||||
# print_percent :print progress
|
||||
# printer_speed :printer speed
|
||||
|
||||
# for MODE use:
|
||||
# progress :the leds will light up one by one
|
||||
# glow :all leds will fade from one color (or non) to other color
|
||||
|
||||
# more info: https://github.com/digitalninja-ro/klipper-neopixel/blob/master/README.md
|
||||
|
||||
[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 %}
|
||||
Reference in New Issue
Block a user