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

    LED ON OFF Macro or Toogle

    Scheduled Pinned Locked Moved
    Gcode meta commands
    9
    16
    1.9k
    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.
    • jay_s_ukundefined
      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
      • MacNiteundefined
        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_123undefined 1 Reply Last reply Reply Quote 0
        • jay_s_ukundefined
          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

          bubblevisorundefined 1 Reply Last reply Reply Quote 4
          • MacNiteundefined
            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
            • MauriceMundefined
              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....

              OwenDundefined 1 Reply Last reply Reply Quote 0
              • OwenDundefined
                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
                • MauriceMundefined
                  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.

                  BoAundefined 1 Reply Last reply Reply Quote 0
                  • BoAundefined
                    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 Koalaundefined
                      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
                      • MacNiteundefined
                        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
                        • Phaedruxundefined
                          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_123undefined
                            user M_123 @MacNite
                            last edited by user M_123

                            This post is deleted!
                            jay_s_ukundefined 1 Reply Last reply Reply Quote 0
                            • jay_s_ukundefined
                              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_123undefined 1 Reply Last reply Reply Quote 0
                              • user M_123undefined
                                user M_123 @jay_s_uk
                                last edited by

                                This post is deleted!
                                1 Reply Last reply Reply Quote 0
                                • bubblevisorundefined
                                  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