Neopixels are fun little widgets
-
A neopixel is an RGB LED with a 1 wire daisy chainable interface. You can string many together into panels or single strands, or whatever. Some of them however, have a strange color model. They have R, G, B, and W(hite) channels. That caused me some grief because representing colors on these is a bit tricky. Well, I finally, after looking at some python code someone dreamed up by hand fiddling came up with an RGBW "color model" in my graphics library. The upshot is I can now for example, pretty faithfully represent a JPG or a GIF (the latter would be fun!) given a large enough panel. Kinda proud of this. It's an elegant solution.
#include using namespace gfx;
...
// create a bitmap in the rgbw color format
auto bmp = create_bitmap>({64,64});
if(bmp.begin()) {
file_stream fs("./test.jpg");
draw::image(bmp,bmp.bounds(),&fs);
fs.close();
// render the bitmap out to leds here...
free(bmp.begin());
}Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
-
A neopixel is an RGB LED with a 1 wire daisy chainable interface. You can string many together into panels or single strands, or whatever. Some of them however, have a strange color model. They have R, G, B, and W(hite) channels. That caused me some grief because representing colors on these is a bit tricky. Well, I finally, after looking at some python code someone dreamed up by hand fiddling came up with an RGBW "color model" in my graphics library. The upshot is I can now for example, pretty faithfully represent a JPG or a GIF (the latter would be fun!) given a large enough panel. Kinda proud of this. It's an elegant solution.
#include using namespace gfx;
...
// create a bitmap in the rgbw color format
auto bmp = create_bitmap>({64,64});
if(bmp.begin()) {
file_stream fs("./test.jpg");
draw::image(bmp,bmp.bounds(),&fs);
fs.close();
// render the bitmap out to leds here...
free(bmp.begin());
}Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
Nice! We use a good number of the RGB type, and they are straight forward to use.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment "Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst "I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
-
Nice! We use a good number of the RGB type, and they are straight forward to use.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment "Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst "I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
Trying to get them to color match is tricky, even with straight RGB because the behavior is far different than an LCD screen.
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
-
Trying to get them to color match is tricky, even with straight RGB because the behavior is far different than an LCD screen.
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
On that I agree, I normally do several passes before I get the color how I want.
"the debugger doesn't tell me anything because this code compiles just fine" - random QA comment "Facebook is where you tell lies to your friends. Twitter is where you tell the truth to strangers." - chriselst "I don't drink any more... then again, I don't drink any less." - Mike Mullikins uncle
-
A neopixel is an RGB LED with a 1 wire daisy chainable interface. You can string many together into panels or single strands, or whatever. Some of them however, have a strange color model. They have R, G, B, and W(hite) channels. That caused me some grief because representing colors on these is a bit tricky. Well, I finally, after looking at some python code someone dreamed up by hand fiddling came up with an RGBW "color model" in my graphics library. The upshot is I can now for example, pretty faithfully represent a JPG or a GIF (the latter would be fun!) given a large enough panel. Kinda proud of this. It's an elegant solution.
#include using namespace gfx;
...
// create a bitmap in the rgbw color format
auto bmp = create_bitmap>({64,64});
if(bmp.begin()) {
file_stream fs("./test.jpg");
draw::image(bmp,bmp.bounds(),&fs);
fs.close();
// render the bitmap out to leds here...
free(bmp.begin());
}Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
Fun indeed - we recently used some high density pixel addressable tape in our amateur theatre production of treasure island, where the parrot was named, not Captain Flint, but Alexa, and had a pulsating necklace which mimicked the effects of the earlier Alexa units when you spoke to the "parrot". Alexa (there were two of them, depending on which side of the stage it was to come from) was a children's stuffed parrot toy, wearing a loop of pixel tape, connected to an Arduino nano IOT which was receiving artnet over WIFI from the lighting desk, all powered by a small USB power bank and the electronics stuffed inside the toy. This meant the toy could be carried around with no trailing cables, and the lighting desk could sent it commands to run patterns and effects on its "necklace". The patterns were programmed into the Arduino rather than sending them directly from the desk so saving on channels in the desk. The necklace had enough pixels tightly packed that the two parrots together would have used up almost half a universe of addresses, whereas the technique used only required two addresses per parrot - intensity and pattern number.
-
A neopixel is an RGB LED with a 1 wire daisy chainable interface. You can string many together into panels or single strands, or whatever. Some of them however, have a strange color model. They have R, G, B, and W(hite) channels. That caused me some grief because representing colors on these is a bit tricky. Well, I finally, after looking at some python code someone dreamed up by hand fiddling came up with an RGBW "color model" in my graphics library. The upshot is I can now for example, pretty faithfully represent a JPG or a GIF (the latter would be fun!) given a large enough panel. Kinda proud of this. It's an elegant solution.
#include using namespace gfx;
...
// create a bitmap in the rgbw color format
auto bmp = create_bitmap>({64,64});
if(bmp.begin()) {
file_stream fs("./test.jpg");
draw::image(bmp,bmp.bounds(),&fs);
fs.close();
// render the bitmap out to leds here...
free(bmp.begin());
}Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
Your lighting reminds me of Stand-up Maths video. I don't remember him doing more than patterns across a Xmas tree. The follow-up video as others optimized his coding was interesting as well. I wired my tree with 500 LED lights and calculated their 3D coordinates. - YouTube[^]
-
Your lighting reminds me of Stand-up Maths video. I don't remember him doing more than patterns across a Xmas tree. The follow-up video as others optimized his coding was interesting as well. I wired my tree with 500 LED lights and calculated their 3D coordinates. - YouTube[^]
This is my latest Neopixel panel + htcw_gfx - YouTube[^]
Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
-
A neopixel is an RGB LED with a 1 wire daisy chainable interface. You can string many together into panels or single strands, or whatever. Some of them however, have a strange color model. They have R, G, B, and W(hite) channels. That caused me some grief because representing colors on these is a bit tricky. Well, I finally, after looking at some python code someone dreamed up by hand fiddling came up with an RGBW "color model" in my graphics library. The upshot is I can now for example, pretty faithfully represent a JPG or a GIF (the latter would be fun!) given a large enough panel. Kinda proud of this. It's an elegant solution.
#include using namespace gfx;
...
// create a bitmap in the rgbw color format
auto bmp = create_bitmap>({64,64});
if(bmp.begin()) {
file_stream fs("./test.jpg");
draw::image(bmp,bmp.bounds(),&fs);
fs.close();
// render the bitmap out to leds here...
free(bmp.begin());
}Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
The idea of an RGBW color model boggles my mind :wtf: . I work in the printing industry so we use CMYK and RGB. If we still had a color scientist (they were a thing for us at one time), I'd ask them about RGBW just to watch their brain asplode.
Software Zen:
delete this;
-
The idea of an RGBW color model boggles my mind :wtf: . I work in the printing industry so we use CMYK and RGB. If we still had a color scientist (they were a thing for us at one time), I'd ask them about RGBW just to watch their brain asplode.
Software Zen:
delete this;
I agree. It's maddening, and my library doesn't fully support it because conversions are not symmetric - IOW, translating to the RGBW model and back to something else again yields a different result than the initial value. It supports it well enough though, but unfortunately you can't do like
rgbw32_colors::antique_white
without causing a compile error due to how the color system works. You can however, either manually construct such a color, or convert it from another color model. It makes no sense. Basically what I did is used someone's hand tuned algorithm for approximating the colors based on an initial Hue/Saturation/Lightness value. It works well enough, but it's not very quick as it actually involves things like cosine computations.Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
-
I agree. It's maddening, and my library doesn't fully support it because conversions are not symmetric - IOW, translating to the RGBW model and back to something else again yields a different result than the initial value. It supports it well enough though, but unfortunately you can't do like
rgbw32_colors::antique_white
without causing a compile error due to how the color system works. You can however, either manually construct such a color, or convert it from another color model. It makes no sense. Basically what I did is used someone's hand tuned algorithm for approximating the colors based on an initial Hue/Saturation/Lightness value. It works well enough, but it's not very quick as it actually involves things like cosine computations.Check out my IoT graphics library here: https://honeythecodewitch.com/gfx And my IoT UI/User Experience library here: https://honeythecodewitch.com/uix
Translating between color models is always problematic... sometimes they don't even agree on what white is :rolleyes: . A fair amount of the time you can do conversions with precomputed tables. Of course I don't know how well that would work for you in your constrained IoT environment.
Software Zen:
delete this;