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

    Script for using DotStar as status indicator LED

    Scheduled Pinned Locked Moved
    Third-party add-ons
    script scripting makro status indicator dotstar
    3
    10
    879
    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.
    • Schild0rundefined
      Schild0r
      last edited by

      Hello there,

      I am coming from a Marlin background but plan to use RRF for my next build in conjunction with a Duet3.
      And since the Duet3 supports DotStar LED strips I was wondering if someone already took advantage of that and wrote a script that uses this as a Status LED (similar to Marlins Status LED using Neopixels).
      I don't have the hardware yet and haven't written any script for RRF yet but I would like to get into it.
      But for now I would like to know whether someone already created a script like this on which I can build upon.

      I would imagine something like this:
      Printer ready: green
      Bed Heating: yellow
      Hotend Heating: red
      Printing: blue
      Print finished: turquoise
      Wait for confirmation (i.e. part removal) to turn green again.
      Advanced version: It would of course be nice to have a color transition for heating the bed from yellow (20°C) to orange (target) and for the nozzle from orange (20°C) to red (target) LED by LED and maybe from blue to turquoise for print progress

      Any help is greatly appreciated

      1 Reply Last reply Reply Quote 0
      • Danalundefined
        Danal
        last edited by Danal

        The very latest firmware has a "daemon.g" that is executed periodically (every 1/2 second, if I recall). It also has a object model that has all the status required for what you are proposing.

        Hook up a dotstar, configure it, and then something like:

        if state.status = "idle"
        M150 R0 U0 B128 Y31 S100 F0 ; Set all 100 leds green.
        if heat.heaters[0].current < 30 ; Bed heating?
        M150 R255 U255 B0 Y31 S100 F0 ; Set all 100 leds yellow.

        and so forth. Probably will require a little bit more elaborate 'and' logic than shown above.

        Delta / Kossel printer fanatic

        1 Reply Last reply Reply Quote 0
        • Schild0rundefined
          Schild0r
          last edited by Schild0r

          Is there some document where I can find all the objects and their attributes?
          And can I code as I would in whatever IDE: Can I do loops and variables for example for the LED by LED logic so that I can define the number of LEDs at the top and than work with that variable?
          Or are their restrictions and only few operators like 'if' you can work with?

          1 Reply Last reply Reply Quote 0
          • Danalundefined
            Danal
            last edited by

            Variables not yet implemented, coming soon...

            Object model can be explored with M409 in the web console. Start with bare M409, then M409 K"key" and drill down via the keys.

            More doc on conditional G-Code: https://duet3d.dozuki.com/Wiki/GCode_Meta_Commands

            Delta / Kossel printer fanatic

            1 Reply Last reply Reply Quote 0
            • Schild0rundefined
              Schild0r
              last edited by

              As I said I don't have the hardware yet so I have to wait until I get it to start exploring hands on 😄

              1 Reply Last reply Reply Quote 0
              • Danalundefined
                Danal
                last edited by

                All you sould need is a strip. Amazon overnight man... get a move on... (kidding, sort of) 🙂

                Delta / Kossel printer fanatic

                Schild0rundefined 1 Reply Last reply Reply Quote 0
                • Schild0rundefined
                  Schild0r @Danal
                  last edited by

                  @Danal and a Duet3... maybe? 😄

                  1 Reply Last reply Reply Quote 0
                  • Danalundefined
                    Danal
                    last edited by

                    Ah... gotcha!

                    Delta / Kossel printer fanatic

                    1 Reply Last reply Reply Quote 0
                    • CharlKleinundefined
                      CharlKlein
                      last edited by

                      Would this be possible on the Duet 2 Maestro ?

                      Asking as Im a complete noob on RRF

                      1 Reply Last reply Reply Quote 0
                      • Danalundefined
                        Danal
                        last edited by

                        Not directly. Only Duet3 hardware supports direct drive of dotstar or neopixel.

                        With Duet 2, you'd have to drive a pin that switched a controller that, in turn, drove the LEDs.

                        Delta / Kossel printer fanatic

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