drawing function returns and will be stopped when appropriate by the rest
of the system.
-* a ws2812 framebuffer object into which all drwaing should happen. This
+* a ws2812 framebuffer object into which all drawing should happen. This
framebuffer should be closed over in any timer callbacks.
* a color parameter, expressed as three arguments 0-255: green, red, blue
function dodraw()
if not isblackout then
if dimfactor > 0 then
- for i=1, ledfb:size() do
- local g,r,b = ledfb:get(i)
- -- dimming, so mix the baseline "all channels on minimum" as 128/256ths
- -- to act as a rounding factor. The image in "ledfb" will be mixed in
- -- as 256/(dimfactor+1) 256ths
- doublefb:mix(128,baselinefb,256/(dimfactor+1),ledfb)
- ws2812.write(doublefb)
- end
+ -- dimming, so mix the baseline "all channels on minimum" as 255/256ths
+ -- to act as a rounding factor. The image in "ledfb" will be mixed in
+ -- as 256/(dimfactor+1) 256ths
+ doublefb:mix(255,baselinefb,256/(dimfactor+1),ledfb)
+ ws2812.write(doublefb)
else
ws2812.write(ledfb)
end