M150 with Adafruit RGBW ring issue?
-
@stephen6309 said in M150 with Adafruit RGBW ring issue?:
@thedragonlord I use this for my 1426, first four for heater 1(T0), second four for Heater 0(bed)
; dameon.g
; Adafruit #1426 8 led neopixel
G4 P500 ; 500ms delay
if heat.heaters[1].current > 40 ; temp
M150 R255 P10 S4 F1 ; set second 4 red, and done
elif heat.heaters[1].current <= 40
M150 U255 P10 S4 F1 ; set second 4 green and done
if heat.heaters[0].current > 40 ; temp
M150 R255 P10 S4 F0 ; set first 4 red
elif heat.heaters[0].current <= 40
M150 U255 P10 S4 F0 ; set first 4 greenF0 starts at the beginning of the strip, F1 continues on.
it doesn't work, if I type S1 no LED is turned on....and I have to set the X parm to 4
-
@thedragonlord Have you tried X3? I'm using the default of X1. I'm using a Duet3 6HC/PI4 and a Mini 5+.
-
@stephen6309 said in M150 with Adafruit RGBW ring issue?:
@thedragonlord Have you tried X3? I'm using the default of X1. I'm using a Duet3 6HC/PI4 and a Mini 5+.
X3 doesn't work at all, but with I've relaized it works with no X parameter setted, but F1 still doesn't work...
-
@thedragonlord Don't know what to try next. I used a macro to test what I ended up using with my deamon.g file.
-
@stephen6309 said in M150 with Adafruit RGBW ring issue?:
@thedragonlord Don't know what to try next. I used a macro to test what I ended up using with my deamon.g file.
maybe with the Duet2WiFi F1 simply doesn't work...I don't know....
-
@thedragonlord Don't know about the Duet 2, since the Duet 3 boards have a connector just for the NEOPixel LEDs.
My are connected to a Mean Well 5vdc on one side of the strip, the other end for the input & GND to the connector.
-
@thedragonlord You need to send at least one command without the F1 to actually set all of the accumulated leds so...
M150 X4 R255 S4 F1
M150 X4 U255 S4 F1
M150 X4 B255 S4
Should set the first 4 to red, the next 4 to green and the next 4 to blue. If you send another command it will start again at the first LED in the string. -
@gloomyandy said in M150 with Adafruit RGBW ring issue?:
M150 X4 B255 S4
uh ok, it works like this, thanks
-
@thedragonlord The way that neopixels work is that you pretty much set them all at once. Basically each set of commands goes to the first pixel and if another set arrives within a short timeout then the previous set of commands are passed on to the next pixel and this continues for each pixel until there is a longer gap in the commands. So to make this work RRF needs to buffer up all of the commands until you have the complete sequence, yo do this by giving the commands with an F1 parameter, then on the final command (with the default F0) RRF sends all of the commands one after the other and all of the pixels in effect get set in one go. So using my previous set of commands the pixel command buffer will look like
RRRRGGGGBBBB where R = (255, 0, 0, 0), B = (0, 255, 0, 0) G=(0, 0, 255, 0) and the values in brackets are the red, green, blue, white values for each pixel. All of these will sent out one after the other when that final G150 with no F command is processed.Hope that makes some sort of sense!
-
@gloomyandy said in M150 with Adafruit RGBW ring issue?:
@thedragonlord The way that neopixels work is that you pretty much set them all at once. Basically each set of commands goes to the first pixel and if another set arrives within a short timeout then the previous set of commands are passed on to the next pixel and this continues for each pixel until there is a longer gap in the commands. So to make this work RRF needs to buffer up all of the commands until you have the complete sequence, yo do this by giving the commands with an F1 parameter, then on the final command (with the default F0) RRF sends all of the commands one after the other and all of the pixels in effect get set in one go. So using my previous set of commands the pixel command buffer will look like
RRRRGGGGBBBB where R = (255, 0, 0, 0), B = (0, 255, 0, 0) G=(0, 0, 255, 0) and the values in brackets are the red, green, blue, white values for each pixel. All of these will sent out one after the other when that final G150 with no F command is processed.Hope that makes some sort of sense!
I'm triyng to use the M150 in a while loop like this:
; Check for T0 to start warming if {global.isTool0Warming==false && tools[0].state=="active"} set global.isToolsStatusChanged=true set global.isTool0Warming=true set global.totalTemperature=global.totalTemperature+tools[0].active[0] ; Check for T0 to start cooling if {global.isTool0Warming==true && tools[0].state!="active"} set global.isToolsStatusChanged=true set global.isTool0Warming=false set global.totalTemperature=global.totalTemperature-tools[0].active[0] ; Recalculate temperature step for each LED if {global.isToolsStatusChanged==true} set global.isToolsStatusChanged=false set global.temperatureStep=global.totalTemperature/24 var index=1 var colore=0 if {global.temperatureStep>0} while {var.index<24} if {heat.heaters[1].current>=global.temperatureStep*var.index} set var.colore=255 else set var.colore=0 ;echo "Step, colore =", var.index, var.colore M150 R0 B0 U{var.colore} S{var.index} F1 set var.index=var.index+1 if {heat.heaters[1].current>=global.temperatureStep*24} ;echo "Step raggiunto =", var.index set var.colore=255 else set var.colore=0 M150 R0 B0 U{var.colore} S24 F0
but it looks like the first M150 inside the loop "freezes" everithing and no LED is setted on....what am I doning wrong?
-
@thedragonlord What are you trying to do with that s{var.index} parameter on the M150, with that code you will be setting first 1 then 2 then 3... up to 24 leds to the selected colour and adding them into the buffer. So by the end of the loop you will have 1+2+3+4+5+6+7...+22+23+24 led commands in the buffer. Given that you only have 24 of them, that does not seem like a very good idea. The S parameter basically specifies the number of LEDS to set to the given colour, not an index into some sort of buffer. As I said above when you use the F1 parameter you are basically accumulating the commands in the command buffer,
-
@gloomyandy said in M150 with Adafruit RGBW ring issue?:
@thedragonlord What are you trying to do with that s{var.index} parameter on the M150, with that code you will be setting first 1 then 2 then 3... up to 24 leds to the selected colour and adding them into the buffer. So by the end of the loop you will have 1+2+3+4+5+6+7...+22+23+24 led commands in the buffer. Given that you only have 24 of them, that does not seem like a very good idea. The S parameter basically specifies the number of LEDS to set to the given colour, not an index into some sort of buffer. As I said above when you use the F1 parameter you are basically accumulating the commands in the command buffer,
Uh, I thought I understood but just for try I tried to set 5 LEDs in green and one LED in red, so I've sended:
M150 U255 R0 B0 S1 P10 F1 M150 U255 R0 B0 S1 P10 F1 M150 U255 R0 B0 S1 P10 F1 M150 U255 R0 B0 S1 P10 F1 M150 U255 R0 B0 S1 P10 F1 M150 U0 R255 B0 S1 P10
and here's what I got:
Only 5 LEDs turned on and the colors "randomly" assigned...
What am I doing wrong again?
EDIT
Maybe I understood, I always have to set the whole set of LEDS to make them work correctlu, right? -
@thedragonlord Where are you setting the LED type? I thought you had RGBW leds, if so at some point you need to tell RRF that is what you have with the X parameter to M150.
-
@gloomyandy said in M150 with Adafruit RGBW ring issue?:
@thedragonlord Where are you setting the LED type? I thought you had RGBW leds, if so at some point you need to tell RRF that is what you have with the X parameter to M150.
I've discovered that if I set the LEDS whan the heater is heating, regardless the numbers, the colors etc. they don't ever be set on. When the heater reaches the temperature the LEDS works normally...
-
@thedragonlord How are you testing that? If you have a simple reproducible case then you should probably describe it so that dc42 can look into it.
-
@gloomyandy said in M150 with Adafruit RGBW ring issue?:
@thedragonlord How are you testing that? If you have a simple reproducible case then you should probably describe it so that dc42 can look into it.
I discovered that if you heat the tools "manually" from the Tools buttons in DWC all gcodes stay queued until the tools reach the setted temperature... I haven't tried if heating from a print acts the same...
-
@thedragonlord you probably have M116 or similar in your tool change files