Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Issue with matrix
#1
Hi there

I'm currently running into an issue with an LED matrix I'm building and was wondering whether anything like this is known or whether there is an issue with my LED strip.
I'm using an LPD8806 Led Strip on a Raspberry PI B+ with Jessie..

Bibliopixel 2.07
spidev 3.1
python 2.7.9

While I tried to dim the matrix gradually to all black [0,0,0] from whatever the colors are i noticed big brightness steps. So I wrote a small test program which gives me the possibility to adjust each color manually.

Code:
from bibliopixel.led import *
from bibliopixel.drivers.LPD8806 import *
import spidev

driver = DriverLPD8806(12*11, c_order = ChannelOrder.BRG, SPISpeed = 2)
led = LEDMatrix(driver, 12, 11)

r = 0
g = 0
b = 0
  
while (1):

    r = int(raw_input("r: "))
    g = int(raw_input("g: "))
    b = int(raw_input("b: "))

    tuple=[r,g,b]
    print tuple

    led.setRGB(5,5,r,g,b)
    led.update()

for red, from [0,0,0] till [27,0,0] the red of the LED's seem to be in an off state.
Then from [28,0,0] till [43,0,0] is the same brightness level
Then from [44,0,0] till [52,0,0] is the same brightness level
and so on in similar ranges all the way to 255. This happens on all the color channels.

Is there a way around this or do I have an issue with my LED-Strip?
#2
That's a known thing with the LPD8806...
Unlike most LEDs, that chipset only has 21-bit color instead of 24-bit. May not sound like much, but it's HALF the colors. So it's already at a disadvantage. Couple that with the fact that the LPD8806 outputs the same constant current value for all three channels, even though our visual perception of each channel is not linear. Basically what this means is that without correction, the colors would look off. Orange would be more yellow, purple too blue, etc.

So, the LPD8806 driver uses what's called gamma correction... which applies a non-linear power output curve to the values... which just so happens to match up EXACTLY with what you see Tongue On 24-bit LEDs, this is not nearly as noticeable.

There's not an official way to disable the gamma correction because, in all our experience.... you need it! But, if you want to try it without, do this:

Code:
driver = DriverLPD8806(12*11, c_order = ChannelOrder.BRG, SPISpeed = 2)
driver.gamma =  [0x80 | int(i/2) for i in range(256)]
led = LEDMatrix(driver, 12, 11)

That will completely disable the non-linear gamma correction. But your colors will most likely not look right.

Hope that helps!
#3
Wow, that actually worked like a charm.
Thank you very much. The steps are much less noticeable.


Forum Jump:


Users browsing this thread: 1 Guest(s)