Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Ignore W channel on M150 if RGBW not Supported

    Scheduled Pinned Locked Moved
    Firmware wishlist
    3
    4
    201
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • robotsneversleepundefined
      robotsneversleep
      last edited by

      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 🙂

      droftartsundefined dc42undefined 2 Replies Last reply Reply Quote 0
      • droftartsundefined
        droftarts administrators @robotsneversleep
        last edited by

        @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

        Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

        robotsneversleepundefined 1 Reply Last reply Reply Quote 0
        • robotsneversleepundefined
          robotsneversleep @droftarts
          last edited by

          @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.

          1 Reply Last reply Reply Quote 0
          • dc42undefined
            dc42 administrators @robotsneversleep
            last edited by

            @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.

            Duet WiFi hardware designer and firmware engineer
            Please do not ask me for Duet support via PM or email, use the forum
            http://www.escher3d.com, https://miscsolutions.wordpress.com

            1 Reply Last reply Reply Quote 1
            • First post
              Last post
            Unless otherwise noted, all forum content is licensed under CC-BY-SA