Ignore W channel on M150 if RGBW not Supported
-
I've been working on some macro's to display printer state (e.g. temperature, % completion) on a 12-LED RGBW NeoPixel ring.
It's something I plan to release in the future to the wider community, so I'll need to support both RGB and RGBW strips.
This means that, for each M150 command, I must query whether or not the W channel is supported, or the output will be wrong:if ledStrips[global.STATUSLED_ID].type == "NeoPixel_RGBW" M150 <...> R255 U255 B255 W255 else M150 <...> R255 U255 B255 ; W component not supported
This can be quite tedious. Is it possible to have the firmware ignore the W component if RGBW is not supported? Thanks a lot
-
@robotsneversleep I think it does already ignore any W parameter if using RGB LEDs. If I send this to an RGB strip:
M950 E0 C"io8.out" T1 ; configure RGB LED strip #0 M150 E0 R0 U0 B255 W255 P40 S6 F0
I just get blue LEDs on. It doesn't generate an error. I think this is because RRF tends to ignore any malformed or irrelevant parameters, rather than generating an error.
Ian
-
@droftarts oh, nice! For some reason I had it in my mind that RRF would either attempt to push the W component to the LED's, or give an error. I wonder if it was happening on a firmware version before 3.5.1.
The macros I wrote make heavy use of arrays anyway, so won't be supported on anything before 3.5.1. Thanks for checking that. -
@robotsneversleep in the M950 command to declare an LED strip you need to specify whether it is RGB or RGBW because RRF has to drive them differently. Assuming you get that right, if you provide a W parameter but the strip was configured as RGB then that parameter will be ignored.