for a LED project that reacts to a person approaching I'd like to have a smooth transition from OFF to the lowest brightness. The output color needs be white and so I started the project off Neopixel RGBW strips. I realised soon that the W staircasing from Off to 1 is too large. So I switched over to FadeCandy and Neopixel RGB strip, hoping that dithering will solve that issue automagically.
It seems that dithering is working, but heavily perceptible to the human eye. The specs mention something around 400fps, but it looks more like 20fps.
I followed the Adafruit FadeCandy Guide, have my server running on OSX with no special configuration file. Tested with 5 LEDs only. Python code to drive looks like this:
Code: Select all
#!/usr/bin/env python
import opc, time
from itertools import cycle
numLEDs = 5
client = opc.Client('localhost:7890')
black = [ (0,0,0) ] * numLEDs
white = [ (1,1,1) ] * numLEDs
# Fade to white
client.put_pixels(black)
client.put_pixels(black)
time.sleep(0.5)
d = 0.50
m = 10
it = cycle(range(0, m) + range(m, 0, -1))
try:
while True:
for v in it:
client.put_pixels([ (v,v,v) ] * numLEDs)
print v
time.sleep(d)
except:
client.put_pixels(black)
client.put_pixels(black)
Have a good day,
Hansipete