Having a problem getting Fastspi_LED running and am looking for suggestions.
I downloaded and got the Sparkfun WS2801 code running on my strip of 32 WS2801 LED’s on an Arduino UNO in a 1.0.1 environment. This code uses Pin 3 for the clock and Pin 2 for the data and works like a charm.
I have been unable to get the Fastspi_LED code running though. Only a single LED lights up. My understanding is that pin 13 is for the clock and pin 11 is for the data.
For power, I have a 9V 1A power supply connected to the Arduino with a .1uF decoupling capacitor between Vin and GND.
Here’s the strip I’m using:
Here’s the start of the Fastspi_LED code I’m using:
Have tried a few combinations of pins, setDataRate values, commenting out the .setLed’s or .setPin line and so on to no avail.
Considering that I can get the Sparkfun code moving pretty fast - under 15ms/sequence of 32 LED’s, I’m wondering what the advantage of this library is?
In the meantime, I've worked out some code for the Sparkfun version which allows me to define multiple sequence types in an array and then cycle through those sequences, each with different effects and variables for colours, delays and number of LED's affected. A work in progress for sure, but it's moving along quite nicely so far.
How long do you have between SPI transfers? The WS2801 waits for some period of inactivity before updating its output. I haven’t looked at the datasheet recently, I want to say 100 or 500uS.
You only posted part or your code, hard to say if that’s the issue.
I haven't been able to get FastSPI_LED to work under 1.0.1, but the same exact code works fine under 0023 ... This is why half of my projects are still only coded under 0023 ...
FWIW I'm the one with the initial bug report on this one, and the patch didn't work as an SVN patch, but I was able to modify the referenced line of code, and adding the SPI_A(0); on line 422 worked.
FWIW I'm the one with the initial bug report on this one, and the patch didn't work as an SVN patch, but I was able to modify the referenced line of code, and adding the SPI_A(0); on line 422 worked.
Tried manually adding SPI_A(0) myself, but it didn't work. I probably screwed up somewhere; maybe didn't delete the .swp files or something. . .
Anyways, I just saw the updated code today and re-installed it all from scratch. FastSPI now works like a charm on the WS2801's and is much faster than the bit blasted code. Guess I've got some retrofitting to do. Looks real smooth too.
Bit blasted version looked like this yesterday (and I've added more sequences since):