Temporal Dithering of NeoPixels on an ATtiny412

https://news.ycombinator.com/rss Hits: 8
Summary

So, I had the thought, wouldn鈥檛 it be neat to have a physical version of the neurodiversity rainbow infinity symbol? Like a little animated thingy that could decorate your desk or maybe be worn as a badge. I couldn鈥檛 find anyone who had created such a thing yet, so I did it myself. If you want to build one, the board design, code, and extras are available on GitHub. If sourcing boards and components seems a bit involved, I might also have extras lying about. The board consists of 27 WS2812B addressable RGB LEDs driven by an ATtiny412. A button on the back cycles through various colors, gradients, animation speeds, patterns and brightness levels. One troublesome aspect of these addressable LEDs is their low color resolution at reasonable brightness levels. It would be nice to have soft color transitions without burning anyone鈥檚 retinas out. With digital images, a common strategy to increase perceived color resolution is to use dithering, patterning available colors to simulate in-between values. Neat idea, but only really works for displays of two or more dimensions with a rather high pixel density. We don鈥檛 have that here. </source> What we do have are pixels with a potentially high refresh rate (Depending on the number of pixels and whether the microcontroller can manage, which is the limiting factor here). If we can鈥檛 do spatial dithering, can we do temporal dithering instead? Apparently, LCD monitors do this, also known as frame rate control. So totally doable. But how? Temporal dithering on highly limited compute There are many different ways of dithering, nicely illustrated on the Dither Wikipedia article. Since, however, our colors are arranged in one dimension and seeking forwards (or backwards) in the sequence would be highly compute or memory intensive, the noted qualities of each method present quite differently here. For our purpose, the choice will either be between an ordered dither or error diffusion. While ordered dither does not need any knowledge of...

First seen: 2025-11-18 01:48

Last seen: 2025-11-18 08:49