Duet3D Logo

    Duet3D

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Documentation
    • Order

    LED ON OFF Macro or Toogle

    Gcode meta commands
    9
    16
    836
    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.
    • MacNite
      MacNite last edited by

      Hey guys,

      I want to turn on or off the LED in my printer. I've done this multiple times using a LED ON and a LED OFF macro.

      I am using a DUET2 Wifi with the most current built of RRF 3.1.1. (will upgrade to 3.2 after the beta-phase is over).

      Is it possible to use a single macro with an if-statement or something like that to turn on/off the LED?

      Thanks for your help,
      Max

      CorEssentials on GitHub | Instructables Profile | Thingiverse Profile

      jay_s_uk 1 Reply Last reply Reply Quote 0
      • jay_s_uk
        jay_s_uk @MacNite last edited by

        @MacNite how do you have your LED set up?
        Can you post the relevant sections of the config and then we can help you with the conditional gcode required

        Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

        1 Reply Last reply Reply Quote 0
        • MacNite
          MacNite last edited by

          Hey - thank you for your help. I am on a business trip right now - so I do not have access to my printer.
          But the code I use is something like that:

          config.g
          
          M950 P1 C"e1heat" Q500	;use heater 1 outupt for LED
          
          LED ON.g
          M42 P1 S1
          
          LED OFF.g
          M42 P1 S0
          
          

          Greets Max

          CorEssentials on GitHub | Instructables Profile | Thingiverse Profile

          user M_123 1 Reply Last reply Reply Quote 0
          • jay_s_uk
            jay_s_uk last edited by

            something along the lines of this should work

            if state.gpOut[1].pwm == 1
               M42 P1 S0
            else
               M42 P1 S1
            

            Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

            bubblevisor 1 Reply Last reply Reply Quote 4
            • MacNite
              MacNite last edited by

              Sorry for the late response.

              I tested the code and it works absolutley flawless!

              Thank you for your help!

              CorEssentials on GitHub | Instructables Profile | Thingiverse Profile

              1 Reply Last reply Reply Quote 1
              • MauriceM
                MauriceM last edited by

                hey, I would like to do exactly the same thing, I'm also on RRF3.1.1 but the gcode above doesn't work for me, it just turns the light on or off depending on what I enter, but I can't switch back and forth with one macro, do I need RRF3.2 or is it something else....

                OwenD 1 Reply Last reply Reply Quote 0
                • OwenD
                  OwenD @MauriceM last edited by OwenD

                  @MauriceM
                  You need to wire your LED to the same pin as shown in the code

                  EDIT:
                  When you say "back and forth", do you mean you want a single change or flashing ?

                  1 Reply Last reply Reply Quote 0
                  • MauriceM
                    MauriceM last edited by

                    Yeah i changed the pin in the Command.

                    My target is it to press the button and the light will go on, and when i press the button again the light turns off.

                    But it does only one. depends on how i configure it.

                    BoA 1 Reply Last reply Reply Quote 0
                    • BoA
                      BoA @MauriceM last edited by

                      @MauriceM Configure trigger for the button, and put this gcode in trigger#.g

                      1 Reply Last reply Reply Quote 0
                      • Krohm Koala
                        Krohm Koala last edited by

                        I've done basically the same thing except, i've configured it as a fan, here's my code (include PSU Control)

                        if fans[3].actualValue == 0
                            M80
                            M106 P3 S1.0
                        else
                            M106 P3 S0
                            M81 S1
                        
                        1 Reply Last reply Reply Quote 0
                        • MacNite
                          MacNite last edited by

                          I've got a new question....is there some kind of "list" of parameters I may refer to?

                          At the moment I want to built a calibration routine for a dual extruder printer.
                          For this I want to check wether filament is loaded. If filament is not loaded, I want to load PLA, if filament is loaded, the routine should continue.

                          See here for more Info on the calibration routine I want to built.
                          https://forum.duet3d.com/topic/21737/rrf3-dual-extruder-calibration-tool-and-nozzle-offset?_=1614175374759

                          Thanks
                          Max

                          CorEssentials on GitHub | Instructables Profile | Thingiverse Profile

                          1 Reply Last reply Reply Quote 0
                          • Phaedrux
                            Phaedrux Moderator last edited by

                            In 3.2 there is a DWC plugin for browsing the object model, does that count as a list?

                            Z-Bot CoreXY Build | Thingiverse Profile

                            1 Reply Last reply Reply Quote 0
                            • user M_123
                              user M_123 @MacNite last edited by user M_123

                              This post is deleted!
                              jay_s_uk 1 Reply Last reply Reply Quote 0
                              • jay_s_uk
                                jay_s_uk @user M_123 last edited by

                                @user-m_123 said in LED ON OFF Macro or Toogle:

                                @jay_s_uk hey
                                i want to on led when my print is stop so can i use this into stop.g????

                                Sure

                                Owns various duet boards and is the main wiki maintainer for the Teamgloomy LPC/STM32 port of RRF. Assume I'm running whatever the latest beta/stable build is

                                user M_123 1 Reply Last reply Reply Quote 0
                                • user M_123
                                  user M_123 @jay_s_uk last edited by

                                  This post is deleted!
                                  1 Reply Last reply Reply Quote 0
                                  • bubblevisor
                                    bubblevisor @jay_s_uk last edited by

                                    @jay_s_uk said in LED ON OFF Macro or Toogle:

                                    if state.gpOut[1].pwm == 1 M42 P1 S0 else M42 P1 S1

                                    Just updated all 7 of my printers with this!!

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