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

    How to read mainbord status on GPIO

    Scheduled Pinned Locked Moved
    Duet Hardware and wiring
    2
    3
    131
    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.
    • Rodrigue Richallandundefined
      Rodrigue Richalland
      last edited by

      Hello everyone,
      I want to know if it's possible to read the mainbord status on GPIO pin ?

      I want to manage a RGB LED whith this variable.

      1bfb0642-b9ff-4e19-962c-591bd97ae411-image.png

      If somebody have already try to do it, i'm interrested.

      Thanks for your precious help😁

      OwenDundefined 1 Reply Last reply Reply Quote 0
      • OwenDundefined
        OwenD @Rodrigue Richalland
        last edited by OwenD

        @Rodrigue-Richalland

        You need to monitor the object model and look at state.status
        The possible values are here
        https://github.com/Duet3D/RepRapFirmware/wiki/Object-Model-Documentation#statestatus

        Then you can use daemon.g to change the led.
        Something like this will update every 2 seconds

        while true 
           if state.status = "idle"
              ; do code to set LED white
           elif state.status = "processing"
              ; do code to set LED green
           elif state.status = "halted"
              ; do code to make led red
           else 
               ; do code to make led yellow for any other state
           G4 S2
        
        Rodrigue Richallandundefined 1 Reply Last reply Reply Quote 2
        • Rodrigue Richallandundefined
          Rodrigue Richalland @OwenD
          last edited by

          @OwenD
          Thanks for you quick reply. I will try.

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