What's new
VORON Design

Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members!

Klipper LED effect

You are missing indenting. That's very important in the config files. This ought to work:
Code:
[neopixel bottom_leds]
pin: PB6
chain_count: 42
color_order: GRB
initial_RED: 0.0
initial_GREEN: 0.0
initial_BLUE: 0.0

[led_effect homing_probe]
autostart: true
frame_rate: 24
leds:
    neopixel: bottom_leds
endstops: x, y, z, probe
layers:
    homing 2.5 0 add (0.3, 0.3, 0.4)

Edit: I noticed just after posting that the homing definition also had RGBW. I removed the W setting as it's no needed (your color order only has GRB, not GRBW).
 
You are missing indenting. That's very important in the config files. This ought to work:
Code:
[neopixel bottom_leds]
pin: PB6
chain_count: 42
color_order: GRB
initial_RED: 0.0
initial_GREEN: 0.0
initial_BLUE: 0.0

[led_effect homing_probe]
autostart: true
frame_rate: 24
leds:
    neopixel: bottom_leds
endstops: x, y, z, probe
layers:
    homing 2.5 0 add (0.3, 0.3, 0.4)

Edit: I noticed just after posting that the homing definition also had RGBW. I removed the W setting as it's no needed (your color order only has GRB, not GRBW).
Thanks, that's clear for me, I did not look at this on copy&paste the code. This is how it looks:
1685541656869.png
but does not work :( Any other hints?
 
A couple of questions:
1. What exactly is bottom_leds defining?
This is my exact definition from my working config. I have the original Rainbow Barf logo PCB and the spec nozzle NeoPixels:
Code:
[neopixel sb_leds]
pin: PB0
#chain_count: 3
chain_count: 10
color_order: GRB, GRB, GRB, GRB, GRB, GRB, GRB, GRB, GRBW,  GRBW
initial_RED: 0.0
initial_GREEN: 0.0
initial_BLUE: 1.0
initial_WHITE: 0.0
# logo (Rainbow Barf PCB) = neopixel:sb_leds (1-8)
# nozzle = neopixel:sb_leds (9,10)
Note the color_order definition. THat allows using both the RGB Rainbow Barf and the RGBW NeoPixels in the same string. Also note my reminder comments at the end; I always define the effects with those exact callouts for the leds on each, and I define the logo & nozzle separately.

2. Is the spacing in your definition spaces or tabs? I'm also not sure if endstops will work as separate lines--I've left mine as a single line as I posted earlier.

Another thought occurred to me. You only have the single definition and set it as add. Change it to top and see if that makes a difference. That and the order you place the various layers makes a big difference (and the simulator doesn't always match actual real behavior).
 
On a slightly different topic, I have a tip for setting colors. I kept getting really bright, washed out colors on my case WS2812B strips, and to some extent the Rainbow Barf logo LED. I found that by putting static 0 0 subtract (0.5,0.5,0.5) as the first layer brought down the brightness and gave me richer colors.
 
A couple of questions:
1. What exactly is bottom_leds defining?
This is my exact definition from my working config. I have the original Rainbow Barf logo PCB and the spec nozzle NeoPixels:
Code:
[neopixel sb_leds]
pin: PB0
#chain_count: 3
chain_count: 10
color_order: GRB, GRB, GRB, GRB, GRB, GRB, GRB, GRB, GRBW,  GRBW
initial_RED: 0.0
initial_GREEN: 0.0
initial_BLUE: 1.0
initial_WHITE: 0.0
# logo (Rainbow Barf PCB) = neopixel:sb_leds (1-8)
# nozzle = neopixel:sb_leds (9,10)
Note the color_order definition. THat allows using both the RGB Rainbow Barf and the RGBW NeoPixels in the same string. Also note my reminder comments at the end; I always define the effects with those exact callouts for the leds on each, and I define the logo & nozzle separately.

2. Is the spacing in your definition spaces or tabs? I'm also not sure if endstops will work as separate lines--I've left mine as a single line as I posted earlier.

Another thought occurred to me. You only have the single definition and set it as add. Change it to top and see if that makes a difference. That and the order you place the various layers makes a big difference (and the simulator doesn't always match actual real behavior).
Thanks for your help! I really don't know where the problem was, something was written wrong as it seems... I completly rewrote the code several times with no success. Now I copied a working configuration from other effects and changed the parts for homing - and it's working :)
 
Anybody have a cfg file I can start with for case light effects? (I have a ring of neos all around the top for general illumunation)

Thanks
 
Anybody have a cfg file I can start with for case light effects? (I have a ring of neos all around the top for general illumunation)

Thanks
have fun :)
 

Attachments

  • stealthburner_led_effects_barf.cfg.txt
    24.5 KB · Views: 37
These should keep you busy for a while. 😁
I just took a peek and....Wow, you have been busy with your Clark Griswald lights going on. I am going to have to look at "borrowing" some of your config.
 
I just took a peek and....Wow, you have been busy with your Clark Griswald lights going on. I am going to have to look at "borrowing" some of your config.
Yes this is the base for my current file. I am trying to get tap and homing to show but I can't figure it out.

Thank you.
 
Here are the relevant definition blocks in my config.
Code:
[led_effect logo_homing]
leds:
    neopixel:sb_leds (1-8)
autostart: false
frame_rate: 24
endstops: x, y, z
layers:
    static 0 0 subtract (0.5,0.5,0.5)
    breathing 8 0 add (0,0.6,0.2),(0,0.46,0.15)
    chase 0.25 0.25 add (0,0.6,0.2)
    homing 4 0 top (0.75,0.75,1.0)

[led_effect logo_meshing]
leds:
    neopixel:sb_leds (1-8)
autostart: false
frame_rate: 24
endstops: z, probe
layers:
    static 0 0 subtract (0.5,0.5,0.5)
    chase -0.30 0.40 add (0.2,1.0,0.0),(0.75,0.79,0.00)
    homing 2.5 0 top (0.75,0.75,1.0)
The magic is first defining the endstops, then that homing layer and putting it on top. With the above definition my SB logo LED flashes white when the endstop is triggered. It was tough to get that figured out (I had to get assistance from the developer).
 
So even if I don't have a mechanical end stop, I would need to add "endstops: x, y, z" ?

If I don't have a logo led at the moment, adding homing to the top should also be required right?

Example
[led_effect Caselights_homing]

Thank you for sharing by the way.
 
Yes, you're telling led_effects what axis you want it to trigger on. The effect can be sent to any NeoPixel LED, I just picked my logo for the Trident. On my V0.2 (sensorless homing on X & Y) I have the case lights flash for X and Y, and the bed LED flash for Z.
 
Doesn't even have to be a Neopixel, can be any LED. you can even use a strip connected to a Heater output. Just configure it as [led]
 
This plugin is great, but lacks one feature. At least for me : "independant" dimmable nozzle LEDs, that can be adjusted from Mainsail or Fluidd, using a slider control.
LED_Effect offers "AnalogPin", that controls a group of LEDs. We just need to send some voltage to the analog pin.

Definition for the nozzle LEDs, in the LED_Effect config file :

( similar to Arduino AnalogRead() )

We need a ADC-able pin. On the Octopus, PC0 for example. It's an analog input with a integrator, it's just perfect !

Code:
[led_effect nozzle_leds]

leds:       neopixel:_barf_neo (9, 10)
autostart:  true
frame_rate: 24
analog_pin: PC0 ; J35 / POWER_DET
layers:
    analogpin 1 0 add (1, 1, 1)
    static    0 0 top (0, 0, 0)

Then, in printer.cfg, we declare a PWM pin that will generate a "analog" voltage. We need a pure MCU pin, without passive crap like another analog input. For example the beeper pin on the EXP1 connector :

( Similar to Arduino AnalogWrite () )

Code:
[output_pin Nozzle_LEDs]

pin: PE8 ; EXT1 / J39 / BEEPER
pwm: true
value: 0.0 ; configured by Barf_Effects.cfg
cycle_time: 0.005
scale: 1

We need some hardware : a Dupont female to female jumper. Plug one end into J35 / PC0 / POWER_DET, and the other end into EXT1 / J39 / BEEPER

1714661654496.png

Done.

And now, we can adjust the nozzle LEDs when using the camera ; No more washed out pictures.

Of course these two LEDs are reserved, and must not be altered by other effects !

1714661077479.png

Forgot to say : if you don't want the stupid and useless RGB control with its color wheel in the interface, just prerfix the neopixel name with an underscore :

"_barf_neo" rather than "barf_neo"

Code:
[neopixel _barf_neo]
pin: EBB36:PD3
chain_count: 10
color_order: GRB, GRB, GRB, GRB, GRB, GRB, GRB, GRB, GRBW, GRBW
 
Last edited:
Top