These are chat archives for Makuna/NeoPixelBus

18th
Dec 2016
joefly888
@joefly888
Dec 18 2016 00:00
@Makuna thanks michael, sorry to keep bothering you. but I am very close to get it back into array on esp, now once done the question is how to I use to RGB values for each led using your library? I only see examples referencing using color definitions...
Michael Miller
@Makuna
Dec 18 2016 00:07
The issue is the order of bytes sent out is truly dependent on which NeoPixels you have. This is why when you init an instance you provide a color feature (NeoGrbFeature) that defines the order your pixels need. Usually you want to transmit in a standard order like R,G,B then translate on the ESP to the pixels you have in your build.
One way to do this is instead of building an array, is to write it into the strip as you parse. So you parse a R,G,B triplit, then instance up a RgbColor object with those, and set the pixel with that.
RgbColor color;

color.R = parseRed(); // how ever you parse it
color.G = parseGreen();
color.B = parseBlue();
strip.SetPixelColor(index, color);
joefly888
@joefly888
Dec 18 2016 00:35
@Makuna OMG !!! Micheal you are my hero, I actually got this project working!! The whole concept has been proven!! I can't believe it !! Thank you so much!!! You gave some much good guidance, I would never have accomplished this without you !!! Ihave only coded it for one led now, but it is reacting correctly to the commands from RPI listening to music.!! I ended up converting the serial to array, through a while loop and setting the RGB to the array values. Does this sound like a correct/smart/efficient way??? Thank you again. I am actually going on vacation for 2 weeks on monday, so glad I was able get it at least conceptually working before holidays... thank you thank you!!
Michael Miller
@Makuna
Dec 18 2016 00:39
@joefly888 Its a fine approach, it can be made faster by skipping the array and just putting the values into the strip but I always suggest an iterative approach at solving problems (get it working, then improve it).
joefly888
@joefly888
Dec 18 2016 00:44
@Makuna thank you for your suggestions!! and support! and your work in this library and beyond!!
MrTrick
@MrTrick
Dec 18 2016 16:21
Evening! I've got some SK6812 RGBW leds and a Wemos D1 mini clone.
Tried the DMA and Uart methods on their respective pins, both work, but with BOTH whenever I program it a bunch of the LEDs go fullbright.
I know this is a problem with the DMA method. Is it known to occur in the UART method as well?
Michael Miller
@Makuna
Dec 18 2016 19:52
The UART is used to program the ESP, both DMA and UART are using the low level hardware that is also used for serial/uploads; so this can happen.
are you just worried about the power surge during upload that you haven't designed in due to only running the brightness at lower levels?
Since the LEDs need 5v, when I prototype I usually run a switch that I can turn them off when I upload; and the final project just doesn't get flashed.
OTA (over the air) flashing should not cause this.
They are reacting to the serial data being sent across the wire and get fooled into thinking its something when its just code being flashed.
MrTrick
@MrTrick
Dec 18 2016 19:55
mainly the power, yes.
I've found that the uart method lights fewer leds, so I'll continue with that, and yes try for OTA flashing later.
Michael Miller
@Makuna
Dec 18 2016 20:04
p.s. I just added a FAQ entry in the Wiki for this here
MrTrick
@MrTrick
Dec 18 2016 21:25
Another thing - I've got a lighting algorithm that returns some quite diverse values for RGB - floats up to about 12.0.
(and mostly around 1.0ish)
They're currently being compressed down with intvalue = 256*(1 - exp(floatvalue)).
However, I have RGBW lights - it would be nice if there was something to use the W channel for.
Michael Miller
@Makuna
Dec 18 2016 23:23
There is a RgbwColor object, and the W value will be used if passed to a strip that uses a w feature like NeoRgbwFeature.
what does it mean floats up to about 12.0? What is up to 12.0 and within what scale? Are you saying your algorithm super saturates above a 1.0f?