I was looking forward to controlling my adafruit WS2081 led strips with the new digispark chip. They are so small, just about the same width as the led strip itself.
However, the adafruit WS2801 library a dependency on SP, which appears to be missing from the digispark.
There's comments out there in the blog world about removing references to SP and letting it rely on "bitbanging", whatever that means.
I can code in processing, but C? not so much. What's bitbanging and/or what might it take to end up with a version of the WS2801 that can work with digispark?
Thanks
LED Strips and Digispark (no sp)
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- pburgess
- Posts: 4161
- Joined: Sun Oct 26, 2008 2:29 am
Re: LED Strips and Digispark (no sp)
"Bitbanging" refers to doing in software something that's normally handled by an on-chip peripheral function. SPI (Serial Peripheral Interface) is one such feature that's present on ATmega chips but not the ATtiny used on the Digispark.
The Adafruit_WS2801 library can operate in either mode (bitbang or hardware SPI)...but as written, still requires hardware support in order to compile, even if it's not used.
The shortest route to getting something working on the Digispark would be to make a fork of the library and strip out all the hardware SPI-specific functions and logic, so only the bitbang cases remain. Adapting the existing code to compile for either case is non-trivial (it might eventually happen, like when Gemma ships, but at this moment there's been no use case and it isn't really a priority).
The Adafruit_WS2801 library can operate in either mode (bitbang or hardware SPI)...but as written, still requires hardware support in order to compile, even if it's not used.
The shortest route to getting something working on the Digispark would be to make a fork of the library and strip out all the hardware SPI-specific functions and logic, so only the bitbang cases remain. Adapting the existing code to compile for either case is non-trivial (it might eventually happen, like when Gemma ships, but at this moment there's been no use case and it isn't really a priority).
- pburgess
- Posts: 4161
- Joined: Sun Oct 26, 2008 2:29 am
Re: LED Strips and Digispark (no sp)
It's a small ATtiny-based wearable board from Adafruit (like Flora, but dinkier). Currently a work-in-progress with no release date set...which is why simply tearing out the SPI-specific logic in the library might be a quicker and easier approach.
- isdale
- Posts: 80
- Joined: Wed Dec 15, 2010 12:54 am
Re: LED Strips and Digispark (no sp)
We found a digispark compatible library on GitHub
https://github.com/nsthorat/LPD8806-bitbang-only
Just tested it and it worked well for 10-20 LED strips
More than that and the digispark gets hot.
https://github.com/nsthorat/LPD8806-bitbang-only
Just tested it and it worked well for 10-20 LED strips
More than that and the digispark gets hot.
- doublejosh
- Posts: 16
- Joined: Fri May 17, 2013 8:53 am
Re: LED Strips and Digispark (no sp)
Still over my head, but this is for LPD8806 rather than WS2801 LED chip strips. Sitting with a stack of Trinkets and strips of WS2801 RGB LEDs in fear of stagnation.
Looks like there may be hope, but still fairly confused.
https://github.com/tenaciousRas/lufa-ws2801
https://digistump.com/board/index.php?topic=227.0
And one more cross-link.
http://forums.adafruit.com/viewtopic.php?f=47&t=44122
Looks like there may be hope, but still fairly confused.
https://github.com/tenaciousRas/lufa-ws2801
https://digistump.com/board/index.php?topic=227.0
And one more cross-link.
http://forums.adafruit.com/viewtopic.php?f=47&t=44122
- adafruit_support_mike
- Posts: 67446
- Joined: Thu Feb 11, 2010 2:51 pm
Re: LED Strips and Digispark (no sp)
It looks like you've added a comment to the end of a thread that's been dormant for some time. What problem are you having?
- doublejosh
- Posts: 16
- Joined: Fri May 17, 2013 8:53 am
Re: LED Strips and Digispark (no sp)
Trying to drive some WS2801 lights with a Trinket. However, all existing libraries rely on the SPI library.
- doublejosh
- Posts: 16
- Joined: Fri May 17, 2013 8:53 am
Re: LED Strips and Digispark (no sp)
OMG. Was able to strip out the SPI pieces from the standard WS2801 library and remove disposable functions to the point where it actually works on a Trinket. Can't believe it. Certainly beats the bitWrite direction I started down.
https://github.com/doublejosh/Blink_Trinket
For those interested I did have a brief bitbang work, but it was based on others' code intended for the LPD8806 model LED strips. You can find that here: https://github.com/doublejosh/Blink_Trinket/releases
https://github.com/doublejosh/Blink_Trinket
For those interested I did have a brief bitbang work, but it was based on others' code intended for the LPD8806 model LED strips. You can find that here: https://github.com/doublejosh/Blink_Trinket/releases
- doublejosh
- Posts: 16
- Joined: Fri May 17, 2013 8:53 am
Re: LED Strips and Digispark (no sp)
Broke off the library into this tidy little repo...
https://github.com/doublejosh/Simple_WS2801
https://github.com/doublejosh/Simple_WS2801
Please be positive and constructive with your questions and comments.