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

    Connect a external button? (Mini 5+)

    Scheduled Pinned Locked Moved
    General Discussion
    2
    5
    186
    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.
    • Chrissundefined
      Chriss
      last edited by

      Hi *,

      my new build (Ratrig V-Cast with a Mini5+) got his LED stripes yesterday. I have the idea that I can control the stripes via one or two buttons. (on/off)

      I have two macros to do that but I see no reason to connect a PanelDue just for executing two macros. Is there a way to connect real buttons to the board and execute them?
      The toolboard docu says "The buttons can be used to generate triggers in the normal way. Their pin names are "button0" and "button1". The required pullup resistors are enabled automatically on these pins."

      So I guess that it should be possible in general, isn't it? Some I/O ports should be available on the Mini5+. Can somebody help me to tight the I/O pins and the macros together?

      Cheers, Chriss

      1 Reply Last reply Reply Quote 0
      • jay_s_ukundefined
        jay_s_uk
        last edited by jay_s_uk

        Yep, just use M581 to set up 2 triggers.
        https://duet3d.dozuki.com/Wiki/Gcode#Section_M581_Configure_external_trigger
        Use the IO pins.
        You could even use the same button and just flip the LEDs on or off

        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

        Chrissundefined 1 Reply Last reply Reply Quote 1
        • Chrissundefined
          Chriss @jay_s_uk
          last edited by

          @jay_s_uk
          Thanks, that was the part I was looking for:

           Any trigger number # greater than 1 causes the macro file sys/trigger#.g to be executed
          

          The idea to flip the state is even better but I did not understand how. Via a "if" condition in the gcode (trigger42.g) or what did I not understood?

          Cheers, Chriss

          1 Reply Last reply Reply Quote 0
          • jay_s_ukundefined
            jay_s_uk
            last edited by

            Basically something like this in the trigger file.

            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

            Chrissundefined 1 Reply Last reply Reply Quote 1
            • Chrissundefined
              Chriss @jay_s_uk
              last edited by

              @jay_s_uk

              Got it.. thanks! I try it later. 😉

              Cheers, Chriss

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