Author Topic: spi ws2801 and adafruit led strips  (Read 7982 times)

jonwa

  • Newbie
  • *
  • Posts: 17
spi ws2801 and adafruit led strips
« on: January 25, 2013, 08:11:31 pm »
One of the big things I was looking forward to doing with the little digispark was controlling led strips that I bought from AdaFruit. Their library for controlling the led strips is this WS2801 library, which is dependent on the SPI library, which doesn't compile with the digispark.


Does anyone know how/if this can be made to work?


Thanks!


in file included...
SPI/SPI.h: In static member function 'static byte SPIClass::transfer(byte)':
error: 'SPDR' was not declared in this scope
error: 'SPSR' was not declared in this scope
error: 'SPIF' was not declared in this scope
In static member function 'static void SPIClass::attachInterrupt()':
error: 'SPCR' was not declared in this scope
error: 'SPIE' was not declared in this scope


etc....

Trakkasure

  • Newbie
  • *
  • Posts: 28
Re: spi ws2801 and adafruit led strips
« Reply #1 on: January 25, 2013, 09:37:20 pm »
It seems there are quite a few issues related to Serial protocols.


I understand there are many many things going on at once, but...
Is there an updated version of the software coming out that will address these?

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: spi ws2801 and adafruit led strips
« Reply #2 on: January 26, 2013, 02:09:45 am »
@jonwa


These two threads might be some help: http://digistump.com/board/index.php/topic,193.msg193.html#msg193
http://digistump.com/board/index.php/topic,163.msg1289.html#msg1289


We will have more formal tutorials on the SPI differences once we have time to write them up after we finish shipping - but yes the Digispark does have SPI, but it is different then the Arduino SPI as it uses something called USI, software SPI can also be used. Some googling for "Attiny85 SPI" might help - also adafruit is releasing a device that is very similar to the Digispark - so I imagine they'll be adding more formal support.

minorthreat

  • Newbie
  • *
  • Posts: 5
Re: spi ws2801 and adafruit led strips
« Reply #3 on: January 29, 2013, 09:52:02 am »
« Last Edit: January 29, 2013, 12:04:16 pm by minorthreat »

jmcmahon443

  • Newbie
  • *
  • Posts: 2
Re: spi ws2801 and adafruit led strips
« Reply #4 on: January 29, 2013, 12:16:57 pm »
http://digistump.com/board/index.php/topic,250.msg1366.html#msg1366


This guy got it to work, post pending approval though.

jonwa

  • Newbie
  • *
  • Posts: 17
Re: spi ws2801 and adafruit led strips
« Reply #5 on: January 30, 2013, 10:56:07 pm »
bitbanging and coding in C are a bit beyond me. I can do processing ok, so I'll have to wait until a compatible spi library appears for digispark, or someone re-writes WS 2801 to get around the differently supported spi.

minorthreat

  • Newbie
  • *
  • Posts: 5
Re: spi ws2801 and adafruit led strips
« Reply #6 on: February 05, 2013, 09:10:27 am »
Sparkfun has a non-spi version of sample code up on there site for ws2801. Seems like that should get you most of the way there. http://www.sparkfun.com/datasheets/Components/LED/LED_Strip_Example.pde