adafruit / Adafruit_DotStar_Pi

DotStar module for Python on Raspberry Pi
GNU General Public License v3.0
60 stars 30 forks source link

dotstar.c 'footer' value results in spurious LED illumination when strip is > numLEDs #5

Closed dtiller closed 6 years ago

dtiller commented 9 years ago

The C file 'dotstar.c' uses 0xFFFFFFFF for the footer value, but using that value results in the numLEDs + 1 LED to be illuminated bright white. According to the blog linked below, the footer is used to clock out data since the clock is delayed at each LED. The data value is not important, and will be pushed 'off the end' of a strip of exactly numLEDs LEDs. When you have a longer strip, that data value will be used for the numLEDs +1 LED (the value starts with '111' which signals an LED frame).

Also, if there are > 64 LEDs, a single 32 bit footer is not sufficient to correctly push out the remaining data. Please change the footer to be 32 * ((numLEDs - 1) div 64 + 1) ZERO bits long.

The blog post: https://cpldcpu.wordpress.com/2014/11/30/understanding-the-apa102-superled/

netsgnut commented 9 years ago

Thanks for the tip @dtiller, I have got my strip (of 288 units) a few days back and observed the LED to be illuminating erroneously as described. Before it is fixed I'd better modify my local version to use a longer footer instead.

timonsku commented 8 years ago

Isn't this fixed by https://github.com/adafruit/Adafruit_DotStar_Pi/commit/8638cb5a7284e3c752a1b38fc0fb05681e056b59 ?

PaintYourDragon commented 6 years ago

I believe it is, yep.