1

I plan to use a single address LED (SK6812 or WS2812) to indicate controller status.

The goal is to include colors: Green / Blue / Red.

There are libraries like Neopixel, Fastled, and others, but I don’t have much space to include them in the program.

How difficult is it to implement color inclusion without the use of libraries and interrupts?

4
  • 3
    You could try the code from this article. It does not use any library for controlling any number of Neopixels. Only code that controls the timing
    – chrisl
    Oct 5 '19 at 12:19
  • 3
    Why not use a regular RGB-led? Connect the led to 3 output pins (with resistors), and use digitalWrite to turn the colors on and off.
    – Gerben
    Oct 5 '19 at 15:14
  • 1
    not difficult ... check the datasheet for required data signal timing
    – jsotola
    Oct 5 '19 at 16:14
  • 1
    Again, to develop a solution we need to know more. The tricky part of controlling the WS2812 is developing a signal that the WS2812 expects. If you are just changing colors, say, no faster than once a second & you can wait and do nothing else with the processor during the fraction of a second it takes to talk to the WS2812, then, as @jsotola said, read the WS2812 data sheet and develop the correct serial signal. You could further simplify it by only requiring the WS2812 to light up Red, Green, Blue or Off. Then you would only need to send out 1 of 4 fixed patterns.
    – st2000
    Oct 5 '19 at 16:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.