How can I use lpd8806.h and FastSPI_LED.h without interfering?

Status
Not open for further replies.

BambooSam

Active member
Hey guys,

I am working on a project where I originally used the fast spi lpd8806.h library to control led strips, I want to keep my original work and continue to build the project using FastSPI_LED.h. They both work fine when the sketch uses either or, but when I call strip.show(); (lpd8806.h) after I use FastSPI_LED.show(); it seems to lock up, so what is causing this? I am guessing its the spi setup, how can I work around this?
I don't have to use the libraries simultaneously, I can basically re-set what ever needs to be re-set before and after I use each library.
Maybe make a public function in each library to set-reset what ever needs to be re-set.
Ex: lpd8806_off(); FastSPI_LED_off(); lpd8806_on(); FastSPI_LED_on();
 
Last edited:
Got it! :D

If anyone else is in the same boat:



/*This:*/ FastSPI_LED.setChipset(CFastSPI_LED::SPI_LPD8806);
/*This:*/ FastSPI_LED.init();
for(int i=0; i<86; i++){
leds.r = 0;
leds.g = 0;
leds.b = 127;
FastSPI_LED.show();
leds.r = 0;
leds.g = 0;
leds.b = 0;
}

/*This:*/ strip.begin();
for(int i=0; i<86; i++){
strip.p(i, 127, 0, 0);
strip.show();
strip.setPixelColor(i, 0,0,0);
}
 
I'm considering building compatibility APIs in a near future release of FastSPI_LED2 so that people can easily move projects from other libraries to FastSPI_LED2 (to make, say, moving from one chipset to another easier). Think there's interest in this?
 
Probably. Mi issue though is that I needed to keep all of my original code, and the way I talk to the strips is a bit different than with fastSPI_LED. Also fastSPI has a much faster fps than the older lpd8806 library, and I didn't want to deal with slowing the rate down. I am glad I made it work because I am extremely happy with fastSPI_LED!!!
 
Status
Not open for further replies.
Back
Top