The WS2801 Arduino library has been updated -- memory usage has been reduced, and hardware SPI support is now an option. For "soft" SPI, performance improvements from the LPD8806 library have been carried over.
Download from github: https://github.com/adafruit/Adafruit-WS2801-Library
To use hardware SPI, simply omit the data and clock pin parameters when invoking WS2801. In other words, this:
- Code: Select all
WS2801 strip = WS2801(25, dataPin, clockPin);
becomes:
- Code: Select all
WS2801 strip = WS2801(25);
Unlike software SPI which is configurable, hardware SPI works only on very specific pins. On the Arduino Uno, Duemilanove, etc., clock = pin 13 and data = pin 11. For the Arduino Mega, clock = pin 52, data = pin 51. For the ATmega32u4 Breakout Board and Teensy, clock = pin B1, data = B2. Alternately, on most boards you can use the 6-pin programming header for SPI output as well, in which case clock = pin 3 and data = pin 4.
There are no other syntax changes; this should be a drop-in replacement. I've tested this (both hardware and software SPI) on a couple different Arduino boards and using both the 0022 and 1.0rc2 versions of the IDE...but sometimes surprises pop up in the wild, so please let me know if you encounter any difficulties with an installation that worked with the prior code.

