Skip to content

Toolhead

Stealthburner LED choreography and the secondary MCU on the toolhead.

stealthburner_leds.cfg

Neopixel ring + nozzle LEDs on the Stealthburner toolhead. State machine drives per-condition colors (idle, heating, printing, error, complete).

# Macros for setting the status leds on the Voron StealthBurner toolhead (or for any neopixel-type leds).
#
# 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.
#
# CONFIGURATION
#
# Example neopixel configuration:
# [neopixel sb_leds]
# pin: <your pin>
# #   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
# #   Sets the initial LED color of the Neopixel. Each value should be
# #   between 0.0 and 1.0. The WHITE option is only available on RGBW
# #   LEDs. The default for each color is 0.#
#
# Most configuration for the macros can be done by modifying the variables in the _sb_vars macro
# at the start of this file. 
#
# MACROS
#
# The following status macros are available:
#    STATUS_READY
#    STATUS_OFF
#    STATUS_BUSY
#    STATUS_HEATING
#    STATUS_LEVELING
#    STATUS_HOMING
#    STATUS_CLEANING
#    STATUS_MESHING
#    STATUS_CALIBRATING_Z
# With additional macros for direct control:
#    SET_NOZZLE_LEDS_ON
#    SET_LOGO_LEDS_OFF
#    SET_NOZZLE_LEDS_OFF
#
# Contributed by Voron discord users wile.e, Tetsunosuke, and etherwalker

[gcode_macro _sb_vars]
# User settings for the StealthBurner status leds. You can change the status colors and led
# configurations for the logo and nozzle here.
variable_colors: {
        'logo': { # Colors for logo states
            'busy': {'r': 0.4, 'g': 0.0, 'b': 0.0, 'w': 0.0},
            'cleaning': {'r': 0.0, 'g': 0.02, 'b': 0.5, 'w': 0.0},
            'calibrating_z': {'r': 0.8, 'g': 0., 'b': 0.35, 'w': 0.0},
            'heating': {'r': 0.3, 'g': 0.18, 'b': 0.0, 'w': 0.0},
            'homing': {'r': 0.0, 'g': 0.6, 'b': 0.2, 'w': 0.0},
            'leveling': {'r': 0.5, 'g': 0.1, 'b': 0.4, 'w': 0.0},
            'meshing': {'r': 0.2, 'g': 1.0, 'b': 0.0, 'w': 0.0},
            'off': {'r': 0.0, 'g': 0.0, 'b': 0.0, 'w': 0.0},
            'printing': {'r': 1.0, 'g': 0.0, 'b': 0.0, 'w': 0.0},
            'standby': {'r': 0.01, 'g': 0.01, 'b': 0.01, 'w': 0.1},
        },
        'nozzle': { # Colors for nozzle states
            'heating': {'r': 0.8, 'g': 0.35, 'b': 0.0, 'w':0.0},
            'off': {'r': 0.0, 'g': 0.0, 'b': 0.0, 'w': 0.0},
            'on': {'r': 0.8, 'g': 0.8, 'b': 0.8, 'w':1.0},
            'standby': {'r': 0.6, 'g': 0.0, 'b': 0.0, 'w':0.0},
        },
        'thermal': {
            'hot': {'r': 1.0, 'g': 0.0, 'b': 0.0, 'w': 0.0},
            'cold': {'r': 0.3, 'g': 0.0, 'b': 0.3, 'w': 0.0}
        }
    }
variable_logo_led_name:         "sb_leds" 
# The name of the addressable LED chain that contains the logo LED(s)
variable_logo_idx:              "1" 
# A comma-separated list of indexes LEDs in the logo
variable_nozzle_led_name:       "sb_leds"
# The name of the addressable LED chain that contains the nozzle LED(s). This will
# typically be the same LED chain as the logo.
variable_nozzle_idx:            "2,3"
# A comma-separated list of indexes of LEDs in the nozzle

variable_thermal_config: {
        'extruder': {
            'cool_temp': 40,
            'leds': 'logo',
        },
        'heater_bed': {
            'cool_temp': 40,
            'leds': 'nozzle',
        },
    }
# temperatures at which cooling will be considered complete

gcode:
    ; Do nothing

[gcode_macro _set_sb_leds]
gcode:
    {% set red = params.RED|default(0)|float %}
    {% set green = params.GREEN|default(0)|float %}
    {% set blue = params.BLUE|default(0)|float %}
    {% set white = params.WHITE|default(0)|float %}
    {% set led = params.LED|string %}
    {% set idx = (params.IDX|string).split(',') %}
    {% set transmit_last = params.TRANSMIT|default(1) %}
    
    {% for led_index in idx %}
        {% set transmit=transmit_last if loop.last else 0 %}
        set_led led={led} red={red} green={green} blue={blue} white={white} index={led_index} transmit={transmit}
    {% endfor %}

[gcode_macro _set_sb_leds_by_name]
gcode:
    {% set leds_name = params.LEDS %}
    {% set color_name = params.COLOR %}
    {% set color = printer["gcode_macro _sb_vars"].colors[leds_name][color_name] %}
    {% set led = printer["gcode_macro _sb_vars"][leds_name + "_led_name"] %}
    {% set idx = printer["gcode_macro _sb_vars"][leds_name + "_idx"] %}
    {% set transmit = params.TRANSMIT|default(1) %}

    _set_sb_leds led={led} red={color.r} green={color.g} blue={color.b} white={color.w} idx="{idx}" transmit={transmit}

[gcode_macro _set_logo_leds]
gcode:
    {% set red = params.RED|default(0)|float %}
    {% set green = params.GREEN|default(0)|float %}
    {% set blue = params.BLUE|default(0)|float %}
    {% set white = params.WHITE|default(0)|float %}
    {% set led = printer["gcode_macro _sb_vars"].logo_led_name %}
    {% set idx = printer["gcode_macro _sb_vars"].logo_idx %}
    {% set transmit=params.TRANSMIT|default(1) %}

    _set_sb_leds led={led} red={red} green={green} blue={blue} white={white} idx="{idx}" transmit={transmit}

[gcode_macro _set_nozzle_leds]
gcode:
    {% set red = params.RED|default(0)|float %}
    {% set green = params.GREEN|default(0)|float %}
    {% set blue = params.BLUE|default(0)|float %}
    {% set white = params.WHITE|default(0)|float %}
    {% set led = printer["gcode_macro _sb_vars"].nozzle_led_name %}
    {% set idx = printer["gcode_macro _sb_vars"].nozzle_idx %}
    {% set transmit=params.TRANSMIT|default(1) %}

    _set_sb_leds led={led} red={red} green={green} blue={blue} white={white} idx="{idx}" transmit={transmit}

[gcode_macro set_logo_leds_off]
gcode:
    {% set transmit=params.TRANSMIT|default(1) %}
    _set_logo_leds red=0 blue=0 green=0 white=0 transmit={transmit}

[gcode_macro set_nozzle_leds_on]
gcode:
    {% set transmit=params.TRANSMIT|default(1) %}
    _set_sb_leds_by_name leds="nozzle" color="on" transmit={transmit}

[gcode_macro set_nozzle_leds_off]
gcode:
    {% set transmit=params.TRANSMIT|default(1) %}
    _set_sb_leds_by_name leds="nozzle" color="off" transmit={transmit}

[gcode_macro status_off]
gcode:
    set_logo_leds_off transmit=0
    set_nozzle_leds_off

[gcode_macro status_ready]
gcode:
    _set_sb_leds_by_name leds="logo" color="standby" transmit=0
    _set_sb_leds_by_name leds="nozzle" color="standby" transmit=1

[gcode_macro status_busy]
gcode:
    _set_sb_leds_by_name leds="logo" color="busy" transmit=0
    set_nozzle_leds_on

[gcode_macro status_heating]
gcode:
    _set_sb_leds_by_name leds="logo" color="heating" transmit=0
    _set_sb_leds_by_name leds="nozzle" color="heating" transmit=1

[gcode_macro status_leveling]
gcode:
    _set_sb_leds_by_name leds="logo" color="leveling" transmit=0
    set_nozzle_leds_on

[gcode_macro status_homing]
gcode:
    _set_sb_leds_by_name leds="logo" color="homing" transmit=0
    set_nozzle_leds_on

[gcode_macro status_cleaning]
gcode:
    _set_sb_leds_by_name leds="logo" color="cleaning" transmit=0
    set_nozzle_leds_on

[gcode_macro status_meshing]
gcode:
    _set_sb_leds_by_name leds="logo" color="meshing" transmit=0
    set_nozzle_leds_on

[gcode_macro status_calibrating_z]
gcode:
    _set_sb_leds_by_name leds="logo" color="calibrating_z" transmit=0
    set_nozzle_leds_on

[gcode_macro status_printing]
gcode:
    _set_sb_leds_by_name leds="logo" color="printing" transmit=0
    set_nozzle_leds_on

KlipperExpander.cfg

Second MCU (STM32F042-based KlipperExpander) for additional toolhead pins — fans, accelerometer, or accessory loads that the Spider can’t drive directly. Connects over USB; serial ID is pinned in this file.

[mcu expander]
serial: /dev/serial/by-id/usb-Klipper_stm32f042x6_1D000A001143564636373420-if00
restart_method: command

# [output_pin mosfet0]
# pin: expander:PA0
# pwm: true
# cycle_time: 0.010
# value: 0
# shutdown_value: 0

# [heater_fan nevermore]
# ##	Controller fan - FAN2 Connector
# pin: expander:PA0
# #kick_start_time: 0.5
# heater: heater_bed
# heater_temp: 40.0
# #fan_speed: 0.5

# max_power: 1.0
# shutdown_speed: 0.0
# kick_start_time: 5.0
# # heater: heater_bed
# # heater_temp: 60
# fan_speed: .5

# [controller_fan nevermore]
# ##	Controller fan - FAN2 Connector
# pin: expander:PA0
# heater: heater_bed
# fan_speed: 1.0
# max_power: 1.0
# shutdown_speed: 0.0
# kick_start_time: 5.0
# # heater: heater_bed
# idle_timeout: 600

[fan_generic nevermore]
##	Controller fan - FAN2 Connector
pin: expander:PA0
#heater: heater_bed
#fan_speed: 1.0
max_power: 1.0
shutdown_speed: 0.0
kick_start_time: 5.0
# heater: heater_bed
#idle_timeout: 600

# [fan_generic Nevermore2]  #does not work
# pin: expander:PA0
# max_power: 1.0
# kick_start_time: 0.5
# #depending on your fan, you may need to increase or reduce this value
# #if your fan will not start
# off_below: 0.25
# cycle_time: 0.010


# [output_pin mosfet1]
# pin: expander:PA1
# pwm: true
# cycle_time: 0.010
# value: 0
# shutdown_value: 0

# [output_pin mosfet2]
# pin: expander:PA2
# pwm: true
# cycle_time: 0.010
# value: 0
# shutdown_value: 0

# [output_pin mosfet3]
# pin: expander:PA3
# pwm: true
# cycle_time: 0.010
# value: 0
# shutdown_value: 0

# Status LED lights when klipper connects 
[static_digital_output onboardLED]
pins: !expander:PA4


# [neopixel expanderPixel]
# pin: expander:PB1
# chain_count: 1
# initial_RED: 0.9
# initial_GREEN: 0.3
# initial_BLUE: 0.0

# Other Pins
# T0 = PA6
# T1 = PA5
# GPIO = PA7