Skip to content

Instantly share code, notes, and snippets.

@tehmaze

tehmaze/printer.cfg

Last active Apr 11, 2021
Embed
What would you like to do?
Klipper color ramp on Mini 12864 display with NeoPixels
[neopixel fysetc_mini12864]
pin: EXP1_6
chain_count: 3
color_order: RGB
initial_RED: 0.0
initial_GREEN: 0.0
initial_BLUE: 0.4
[delayed_gcode set_displaytemp_timer]
initial_duration: 1
gcode:
SET_LED_TEMPERATURES
UPDATE_DELAYED_GCODE ID=set_displaytemp_timer DURATION=1
[gcode_macro SET_LED_TEMPERATURES]
gcode:
# Make display red if any heater is above 50C
{% if printer.extruder.temperature >= 50 or printer.heated_bed.temperature >= 50 %}
SET_LED LED=fysetc_mini12864 RED=1.00 GREEN=0.00 BLUE=0.00 INDEX=1
{% else %}
SET_LED LED=fysetc_mini12864 RED=0.00 GREEN=1.00 BLUE=1.00 INDEX=1
{% endif %}
{% if printer.extruder.temperature >= 180 %}
SET_LED LED=fysetc_mini12864 RED=1.00 GREEN=0.50 BLUE=0.00 INDEX=2
{% elif printer.extruder.temperature >= 160 %}
SET_LED LED=fysetc_mini12864 RED=1.00 GREEN=0.40 BLUE=0.00 INDEX=2
{% elif printer.extruder.temperature >= 140 %}
SET_LED LED=fysetc_mini12864 RED=1.00 GREEN=0.30 BLUE=0.00 INDEX=2
{% elif printer.extruder.temperature >= 120 %}
SET_LED LED=fysetc_mini12864 RED=1.00 GREEN=0.20 BLUE=0.00 INDEX=2
{% elif printer.extruder.temperature >= 100 %}
SET_LED LED=fysetc_mini12864 RED=1.00 GREEN=0.10 BLUE=0.00 INDEX=2
{% elif printer.extruder.temperature >= 80 %}
SET_LED LED=fysetc_mini12864 RED=1.00 GREEN=0.00 BLUE=0.00 INDEX=2
{% elif printer.extruder.temperature >= 60 %}
SET_LED LED=fysetc_mini12864 RED=0.66 GREEN=0.00 BLUE=0.33 INDEX=2
{% elif printer.extruder.temperature >= 40 %}
SET_LED LED=fysetc_mini12864 RED=0.33 GREEN=0.00 BLUE=0.66 INDEX=2
{% else %}
SET_LED LED=fysetc_mini12864 RED=0.00 GREEN=0.00 BLUE=1.00 INDEX=2
{% endif %}
{% if printer.heater_bed.temperature >= 100 %}
SET_LED LED=fysetc_mini12864 RED=1.00 GREEN=0.50 BLUE=0.00 INDEX=3
{% elif printer.heater_bed.temperature >= 90 %}
SET_LED LED=fysetc_mini12864 RED=1.00 GREEN=0.40 BLUE=0.00 INDEX=3
{% elif printer.heater_bed.temperature >= 80 %}
SET_LED LED=fysetc_mini12864 RED=1.00 GREEN=0.30 BLUE=0.00 INDEX=3
{% elif printer.heater_bed.temperature >= 7 %}
SET_LED LED=fysetc_mini12864 RED=1.00 GREEN=0.20 BLUE=0.00 INDEX=3
{% elif printer.heater_bed.temperature >= 60 %}
SET_LED LED=fysetc_mini12864 RED=1.00 GREEN=0.10 BLUE=0.00 INDEX=3
{% elif printer.heater_bed.temperature >= 50 %}
SET_LED LED=fysetc_mini12864 RED=1.00 GREEN=0.00 BLUE=0.00 INDEX=3
{% elif printer.heater_bed.temperature >= 40 %}
SET_LED LED=fysetc_mini12864 RED=0.66 GREEN=0.00 BLUE=0.33 INDEX=3
{% elif printer.heater_bed.temperature >= 30 %}
SET_LED LED=fysetc_mini12864 RED=0.33 GREEN=0.00 BLUE=0.66 INDEX=3
{% else %}
SET_LED LED=fysetc_mini12864 RED=0.00 GREEN=0.00 BLUE=1.00 INDEX=3
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment