adafruit / Adafruit_DotStar_Pi

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

Can't control more than 256 LEDs #14

Closed timonsku closed 8 years ago

timonsku commented 8 years ago

I'm hitting a very weird hard limit of 256 LEDs per Pi. In both SPI and bitbang mode. I increased the BLOCK_SIZE and spidev.bufsize by several factors but no effect. This seems like a software defined limit but I'm not quite sure where it comes from. I'm using a PI2. What I read in bug https://github.com/adafruit/Adafruit_DotStar_Pi/issues/10 this can't be a hardware limitation as the default values for BLOCK_SIZE and spidev.bufsize should allow already more than 256 LEDs.

Any insight why this might happen?

E: I noticed this happens because I'm using the c code directly. Maybe I should have started with that info.. One major thing that I changed was in instead of DotStarObject *self = NULL; I assigned this DotStarObject *self = malloc(sizeof(DotStarObject)); So I can omit these python specific C API functions if((self = (DotStarObject *)type->tp_alloc(type, 0))) {

I find it really hard to debug. This definitely looks like a type or allocation issue.

timonsku commented 8 years ago

Nvm, this was a stupid mistake in my test main(). I used unit8_t in a loop to write to the LEDs for some stupid reason...