Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Feature Requests
  3. status LED's controlled by a user callback

status LED's controlled by a user callback

Scheduled Pinned Locked Moved Feature Requests
7 Posts 3 Posters 2.8k Views 2 Watching
  • 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.
  • tbowmoT Offline
    tbowmoT Offline
    tbowmo
    Admin
    wrote on last edited by
    #1

    Just a thought, could we have a user provided callback routine, to handle the status LED's in the GW?

    This way we could use different LED driver types (like ws2812b RGB led's f.ex) for status LED.

    1 Reply Last reply
    0
    • R Offline
      R Offline
      rickmontana83
      wrote on last edited by
      #2

      Haven't looked at the code for the gateway, but in c++ if the functionality is implemented in a public or protected class member that is declared virtual then subclasses can redefine the behavior by overriding that method. Might be a workable avenue...

      1 Reply Last reply
      0
      • R Offline
        R Offline
        rickmontana83
        wrote on last edited by
        #3

        Oof... Looked at the code. It's probably possible, but not with a trivial mod. The logic is handled across several functions. Best bet would prob be to factor digitalWrite() calls in ledTimersInterrupt to a replaceable function pointer. You'll have more global data lying around, but that's already being done in the library, so it doesn't really compromise design integrity much.

        1 Reply Last reply
        0
        • tbowmoT Offline
          tbowmoT Offline
          tbowmo
          Admin
          wrote on last edited by
          #4

          @rickmontana83

          Well, it's arduino, so not C++ (Ok, the libraries are c++ if I remember right, but the rest isn't)

          I'm just asking for a generic way to plug in whatever you want for status indication on the GW (could also be a LCD display for that matter)

          R 1 Reply Last reply
          0
          • tbowmoT tbowmo

            @rickmontana83

            Well, it's arduino, so not C++ (Ok, the libraries are c++ if I remember right, but the rest isn't)

            I'm just asking for a generic way to plug in whatever you want for status indication on the GW (could also be a LCD display for that matter)

            R Offline
            R Offline
            rickmontana83
            wrote on last edited by
            #5

            @tbowmo
            The Arduino ide hides some things (like main()), and some features of the language are disabled throughout to keep code size down, but it's all fed through the C++ compiler in the end. So all the normal C++ OO concepts work both in libraries and in sketches.

            I think a lot of times sketches don't use classes because it's overkill and it's really easy to accidentally blow through all your memory if you don't really understand what the compiler generates, but it's definitely possible.

            1 Reply Last reply
            0
            • blaceyB Offline
              blaceyB Offline
              blacey
              Admin
              wrote on last edited by
              #6

              @thozza recently reworked the LED implementation in the core library so he would be a good one to chime in on the options.

              1 Reply Last reply
              0
              • tbowmoT Offline
                tbowmoT Offline
                tbowmo
                Admin
                wrote on last edited by
                #7

                @blacey

                Yup, @hek also pointed me in the directions of those changes.

                However, while reading up on the communication specs for the ws2812b (as I had in mind using for the GW), I found them to be very timing critical, so I think it would be too much trouble to implement this type of controller for the status LED's, and therefore I have dropped that idea again. :)

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                17

                Online

                11.7k

                Users

                11.2k

                Topics

                113.1k

                Posts


                Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • MySensors
                • OpenHardware.io
                • Categories
                • Recent
                • Tags
                • Popular