PDA

View Full Version : WS2812b and similar LEDs - do we need all time running tight loop for control?



CuriousOne
- 22nd August 2020, 06:03
Hello.

I've checked code examples found here, and by my understanding, I see that it is required to send tight timed pulse signals for those leds, which some folks done via assembly. So my question is as follows. I have some code running which does a lot of things, like reading DS3231, 18B20, driving nixie tubes, etc. I have idea to use WS2812b leds as configurable blinking separator. So I need it to be on for 500ms, off 500ms. Color defined once, by user, at startup. So I need constant running code to keep it turned on, or I just send burst of pulses, turn it on, then do my things, then again send code for off, and can do my things?

HenrikOlsson
- 22nd August 2020, 07:35
You don't have to refresh them continously, it's enough to update the string of LEDs when you need/want something to change. Just realise that in order to change one of the LEDs in the string you will have to send data for the whole string.

CuriousOne
- 22nd August 2020, 21:54
Thanks, I only will have two of such leds, and both should display same color. So what if I connect their inputs in parallel?

Dave
- 23rd August 2020, 14:05
Yes, That can be done as I have paralleled up to 8 strings of 30 pixels each.

Ioannis
- 23rd August 2020, 17:56
The WS2812 have need fast pulses and your PIC should be fast as well.

The APA101 are much more tolerant and can be driven slower enough for any PIC to handle.

Ioannis