Digistump Forums
The Digispark => Digispark (Original) Support => Topic started by: jonwa 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....
-
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?
-
@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.
-
This tutorial seems very promising.
http://playground.arduino.cc/Code/USI-SPI (http://playground.arduino.cc/Code/USI-SPI)
http://playground.arduino.cc/Code/USIi2c (http://playground.arduino.cc/Code/USIi2c)
-
http://digistump.com/board/index.php/topic,250.msg1366.html#msg1366 (http://digistump.com/board/index.php/topic,250.msg1366.html#msg1366)
This guy got it to work, post pending approval though.
-
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.
-
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 (http://www.sparkfun.com/datasheets/Components/LED/LED_Strip_Example.pde)