Hi Oliv'
just wanted to ask if you already made any progress
Driver for WS2812
Re: Driver for WS2812
Hello !nui_de wrote:just wanted to ask if you already made any progress
No I didn't because I do not need a lot of leds, for now.
So I did not tried to improve speed, and I think that the most efficient way is to activate DMA.
- danicampora
- Posts: 342
- Joined: Tue Sep 30, 2014 7:20 am
- Contact:
Re: Driver for WS2812
DMA will come, but we need the asynchronous API as well. DMA by itself won't save anytime if you still have to wait for the transfer to complete before moving on.
Re: Driver for WS2812
Yes asynchronous is mandatory, I thought it was included as for the PyBoard.danicampora wrote:DMA will come, but we need the asynchronous API as well. DMA by itself won't save anytime if you still have to wait for the transfer to complete before moving on.
By the way it is good to know, thanks
- danicampora
- Posts: 342
- Joined: Tue Sep 30, 2014 7:20 am
- Contact:
Re: Driver for WS2812
My bad !danicampora wrote:The pyboard doesn't have an asynchronous API yet...
I have misread this post, sorry !
Re: Driver for WS2812
Hi Daniel,
I only wanted to report two obvious bugs in your source:
https://github.com/danicampora/wipy/blo ... /ws2812.py
First, please look at the SPI values: (corrected version)
You have to interchange bits[1] and bits[2]
Second thing I found in function 'update' it should be:
else the two LSB get never set.
Now I have really smooth color fading and brightness control !
This also affects the Library by Oliv' since it uses the same bytearray
I only wanted to report two obvious bugs in your source:
https://github.com/danicampora/wipy/blo ... /ws2812.py
First, please look at the SPI values: (corrected version)
Code: Select all
# values to put inside the SPI register for each bit of color
bits = (bytearray((0xE0, 0xE0)), bytearray((0xE0, 0xFC)),
bytearray((0xFC, 0xE0)), bytearray((0xFC, 0xFC)))
Second thing I found in function 'update' it should be:
Code: Select all
for bit in range (0, 8, 2):
Now I have really smooth color fading and brightness control !
This also affects the Library by Oliv' since it uses the same bytearray