-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Single neopixel element for all smart LEDs types and layouts (started as Gamma-Correction but got into a general solution) #240
Comments
Thanks! I opened this for vote: https://wokwi.com/features#feature-1079348122 |
The Neopixel elements already have a brightness correction attribute: It is also possible to use a scale factor that results in values brighter than 100%. The LEDs will be capped at maximum brightness if there is any overshoot. For some effects, this can make the end result even more clearly visible in the sim, but of course it can result in the colours being different. Here is a project that benefited from this. @urish, regarding gamma correction, I've done more research and I believe my original suggestion of raising each R, G, B value to the power of 1/monitor_gamma_curve is broadly correct. I originally suggested 1/1.8 = 0.55 for the monitor's gamma exponent. I've since learned this value was specific to Apple computers/monitors; everything else seems to use 1/2.2 = 0.45 as the exponent. The current ITU recommendation BT.709 item 3.1 says that 1/2.2 = 0.45 should be the standard for modern screens. My current monitor defaults to 2.2, and allows choices of 1.8, 2.2 and 2.6. All other sources I have found seem to agree, e.g. this discussion of colour space conversions. So, on recent monitors, |
Thank you so much for looking into this, Steve! I added a temporary way to set the gamma for a neopixel-canvas, "_temp_gamma" attribute. Here's an example with gamma correction factor set to 0.45: https://wokwi.com/arduino/projects/318128789338980929 How does that look to you? |
Oh, that's great. Thanks, Uri. It seems to closely match what I see on my LEDs matrices. |
So I guess the only question is: how should we introduce it? The easiest approach would probably be to make this opt-in: there's no gamma correction, unless you specify one. Thoughts? |
Yeah, opt-in seems fine to me. There's no need to affect the behaviour of existing projects. Those who care about it will discover it in the docs. |
Then, what about |
I think |
I just play with the neopixels and here is what I got: 1. The I have connected all neopixel modules to the same arduino pin and set Gamma correction example looks good! thanks for that @urish ! |
Yes, these LEDs are pretty messy at the moment. See my comments here: #59 (comment) We had a discussion about that in discord a few months ago: https://discord.com/channels/787627282663211009/797922013389389824/875847352169136228 My suggestion was:
Even though now there's also your request for RGBW LEDs and such: #243. Once we decide on a good naming scheme, I can go on implementing it, making sure they are all behaving consistently (e.g. having a similar gamma correction algorithm), and documenting them / adding them to the green "+" button |
I see, the wokwi-neopixel-strip 3D examples looks great! So I can only suggest not including the LED chipset in the element name - How about a single neopixel element to rule them all?
And in the "+" menu we can add a "neopixels" sub-menu with some common option-
This method can be used to combine others element with common base like the This way there will be less items on the main "+" menu, and some docs pages can be combined :) |
Thanks for sharing your feedback!
The name NeoPixels refers to WS2812, and if I'm not wrong, it's Adafruit who came up with the name. So probably a different name would make more sense. Also, I'm different kinds (APA102 / WS2812 / etc.) have a different number of pins / pin types, so it might be more confusing to combine them all into one part. Especially, given that the attributes depend on the type of parts you choose. For instance, the splendida is always WS2812 with 256 pixels in a very specific arrangement. So if we try to come up with a single element that supports everything, there'll be many invalid combinations that we'll have to worry about.
In general, I'd prefer to stick with parts that match physical parts you can actually buy. So I'm not sure we'll gain anything by combining LCD1602 and LCD2004 or the LED and RGB LED. Or did you mean something else? |
Hi, I am also not a fan of "NeoPixel" and "DotStar" names - I call them smart leds :) I still think combining them is better - because they are all the same family of parts and user can easily swap the LED type or board shape without replacing the element. About the different pinout - There are only 2 options here - single DIN or DIN+CLK - and the wokwi-7segment also support multi layouts and pinouts. The invalid combinations are also OK - this is all the fun in the simulator vs real-world - Yes I ment exactly that - just like I keep the LCD1602 and LCD2004 LCDs in a same drawer in real life- Sorry for long message but hope I well explained my tendency to combine common elements :) |
"NeoPixel" and "DotStar" Are what the masses call them. |
@leftCoast NeoPixel is a registered trademark of Adafruit / Limor Fried in the US, Israel, UK and many other territories. I would expect them to also trademark DotStar if they start making significant profits off them. Wokwi would have to call them Neopixel-compatible to avoid any possible threats of legal action. "ARGB" (Addressable RGB) seems to be gaining in recognition as a term to distinguish addressable strips from the old RGB power bus strips. |
Would love to see support for SK6812 IC for addressable WRGB LED arrays. Those have become so common. Would love know how I can help. I would suggest a simple strip of 6 LEDs/ICs, that would be plenty to test and develop. |
Do you have some example code that would drive such an LED? I don't have the hardware, but I could try to prototype something if I had code I know works. |
This issue has been getting a lot of votes recently and climbing up the feature list, so let's try to put together a plan how to implement it. @sutaburosu raised a valid concern about Neopixel being Adafruit's trademark. Their website says:
I'd love to get a clarification from someone from Adafruit what they feel comfortable with. Should we drop "Neopixel" altogether, or is it okay to use it in the context of the simulator? Perhaps @ladyada could chime in and help here. Once we figure this out, we can try to come up with a good naming scheme for the different kinds/models of LED strips/rings/matrices. |
hiya - you can use "NeoPixel Compatible" if that is accurate. |
I haven't tested this myself on real hardware, but I've heard that this sketch works correctly on RGBW addressable LEDs. Or should I say GRBW, as that's the order in which those LEDs want the colour data to be presented. |
Is your feature request related to a problem? Please describe.
I made a small RGBDuino test and found out that I must set the neopixels brightness to 12% in real life because they are too bright and takes high current, but inside the simulator the 12% shows very dim and it is hard to see the colors.
Describe the solution you'd like
Adding a gamma_correction and brightness attributes to the RGB-LED and NeoPixels - so the user can set it to look good on the simulator.
The text was updated successfully, but these errors were encountered: