USER-LED settings

Ich habe hier folgende LEDs: 1. Nozzle-LEDs
[neopixel nozzle_led_t0]
pin: toolboard_t0:PD3
chain_count: 2
color_order: GRB
initial_RED: 1.0
initial_GREEN: 1.0
initial_BLUE: 1.0

[gcode_macro RatOS]
variable_led_status_action: 1.0, 0.0, 1.0
variable_led_status_success: 1.0, 0.0, 0.0
variable_led_status_error: 0.0, 1.0, 1.0
variable_led_status_on: 1.0, 1.0, 1.0
variable_led_status_off: 0.0, 0.0, 1.0
variable_led_status_standby: 0.1, 0.1, 0.1
[neopixel nozzle_led_t0]
pin: toolboard_t0:PD3
chain_count: 2
color_order: GRB
initial_RED: 1.0
initial_GREEN: 1.0
initial_BLUE: 1.0

[gcode_macro RatOS]
variable_led_status_action: 1.0, 0.0, 1.0
variable_led_status_success: 1.0, 0.0, 0.0
variable_led_status_error: 0.0, 1.0, 1.0
variable_led_status_on: 1.0, 1.0, 1.0
variable_led_status_off: 0.0, 0.0, 1.0
variable_led_status_standby: 0.1, 0.1, 0.1
Dann habe ich noch 2 LED-Ketten verbaut, die auf den Namen "light2" und "ligth2" hören:
[neopixel light1]
pin: PB0
chain_count: 29
color_order: GRB
initial_RED: 0
initial_GREEN: 0
initial_BLUE: 0

[neopixel light2]
pin: PB6
chain_count: 53
color_order: GRB
initial_RED: 0
initial_GREEN: 0
initial_BLUE: 0

[gcode_macro _USER_LED_SET]
gcode:
# parameter
{% set toolhead = params.TOOLHEAD|default(-1)|int %}
{% set r = params.R|default(0)|float %}
{% set g = params.G|default(0)|float %}
{% set b = params.B|default(0)|float %}

# replace MY_LED_NAME with the name you choosed for the custom LED
SET_LED LED="light1" RED={r} GREEN={g} BLUE={b} SYNC=0
SET_LED LED="light2" RED={r} GREEN={g} BLUE={b} SYNC=0
[neopixel light1]
pin: PB0
chain_count: 29
color_order: GRB
initial_RED: 0
initial_GREEN: 0
initial_BLUE: 0

[neopixel light2]
pin: PB6
chain_count: 53
color_order: GRB
initial_RED: 0
initial_GREEN: 0
initial_BLUE: 0

[gcode_macro _USER_LED_SET]
gcode:
# parameter
{% set toolhead = params.TOOLHEAD|default(-1)|int %}
{% set r = params.R|default(0)|float %}
{% set g = params.G|default(0)|float %}
{% set b = params.B|default(0)|float %}

# replace MY_LED_NAME with the name you choosed for the custom LED
SET_LED LED="light1" RED={r} GREEN={g} BLUE={b} SYNC=0
SET_LED LED="light2" RED={r} GREEN={g} BLUE={b} SYNC=0
Wie kann ich nun die USER_LED so steuern, dass sie ausschließlich weiß leuchten, statt die Farbe der Nozzle-LEDs zu übernehmen?
4 Replies
Helge Keck
Helge Keck4mo ago
also wenn du nicht willst das er light1 und 2 kontrolliert, dan nehme die einfach da raus
Rigattoni
RigattoniOP4mo ago
Scheint ich bin zu doof das zu verstehen... In der LED_CONFIG steht Folgendes, was mich irritiert:
[gcode_macro _LED_SET]
gcode:
# parameter
{% set toolhead = params.TOOLHEAD|default(-1)|int %}
{% set r = params.R|default(0)|float %}
{% set g = params.G|default(0)|float %}
{% set b = params.B|default(0)|float %}

{% if toolhead >= 0 %}
{% if printer['neopixel nozzle_led_t%s' % toolhead] is defined %}
SET_LED LED={'nozzle_led_t%s' % toolhead} RED={r} GREEN={g} BLUE={b} SYNC=0
{% endif %}
{% else %}
{% if printer['neopixel nozzle_led_t0'] is defined %}
SET_LED LED={'nozzle_led_t0'} RED={r} GREEN={g} BLUE={b} SYNC=0
{% endif %}
{% if printer['neopixel nozzle_led_t1'] is defined %}
SET_LED LED={'nozzle_led_t1'} RED={r} GREEN={g} BLUE={b} SYNC=0
{% endif %}
{% endif %}

_USER_LED_SET { rawparams }

[gcode_macro _USER_LED_SET]
gcode:
# parameter
{% set toolhead = params.TOOLHEAD|default(-1)|int %}
{% set r = params.R|default(0)|float %}
{% set g = params.G|default(0)|float %}
{% set b = params.B|default(0)|float %}

# replace MY_LED with the name of your custom LED configuration
# SET_LED LED="MY_LED" RED={r} GREEN={g} BLUE={b} SYNC=0
[gcode_macro _LED_SET]
gcode:
# parameter
{% set toolhead = params.TOOLHEAD|default(-1)|int %}
{% set r = params.R|default(0)|float %}
{% set g = params.G|default(0)|float %}
{% set b = params.B|default(0)|float %}

{% if toolhead >= 0 %}
{% if printer['neopixel nozzle_led_t%s' % toolhead] is defined %}
SET_LED LED={'nozzle_led_t%s' % toolhead} RED={r} GREEN={g} BLUE={b} SYNC=0
{% endif %}
{% else %}
{% if printer['neopixel nozzle_led_t0'] is defined %}
SET_LED LED={'nozzle_led_t0'} RED={r} GREEN={g} BLUE={b} SYNC=0
{% endif %}
{% if printer['neopixel nozzle_led_t1'] is defined %}
SET_LED LED={'nozzle_led_t1'} RED={r} GREEN={g} BLUE={b} SYNC=0
{% endif %}
{% endif %}

_USER_LED_SET { rawparams }

[gcode_macro _USER_LED_SET]
gcode:
# parameter
{% set toolhead = params.TOOLHEAD|default(-1)|int %}
{% set r = params.R|default(0)|float %}
{% set g = params.G|default(0)|float %}
{% set b = params.B|default(0)|float %}

# replace MY_LED with the name of your custom LED configuration
# SET_LED LED="MY_LED" RED={r} GREEN={g} BLUE={b} SYNC=0
_USER_LED_SET geht auch auf die Settings vom Toolhead...
Helge Keck
Helge Keck4mo ago
nimm deine leds da raus sonst werden die immer angesgtuert und dann schalte deine leds in den macros and aus wo du das willst hab dir doch vorher ein besiepiel gegeben
Rigattoni
RigattoniOP4mo ago
Ich habs begriffen... funktioniert. Macht es Sinn das in die Doku mit rein zu packen?
Want results from more Discord servers?
Add your server