-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
APA102 LED "n+1" is lighted on write() #3037
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Does anyone have an APA102 that they can test this with? |
I do. I have one of these: https://www.adafruit.com/product/2240 |
I can reproduce this bug on my Wemos D1 Mini v2.1.0 ESP8266.
Test 1 👎
Test 2 👎
Test 3 👎
Test 4 👎
(disconnect and reconnect led strip) Test 5 👎
Test 6 👎
(disconnect and reconnect led strip) Test 7 👎
(disconnect and reconnect led strip) Test 8 👎
(disconnect and reconnect led strip) Test 9 👎
(disconnect and reconnect led strip) Test 10 - Works! 👍
Test 11 👎
|
It appears my strip is one of the newer strips with APA102C's with a different colour order, RBG. |
Recorded the first 3 tests using a logic analyser: apa102-tests-saleae-logic.zip There is one for Neopixel strips. |
Oh, it's just SPI! Test 1:
Test 2:
Test 3:
http://hackaday.com/2014/12/09/digging-into-the-apa102-serial-led-protocol/ https://cpldcpu.com/2014/11/30/understanding-the-apa102-superled/
Perhaps sending 1,1,1,1 as the end frame would fix it. |
Sending the 32-bit end frame as /esp8266/espapa102.c:94 Reading more about it and it seems the datasheet may be wrong. You don't actually need to send the end frame, as long as you are sending the additional padding bits, which we are in the I tried commenting out Init strip of 6 pixels, set to R,G,B,R,G,B - no extra white pixel Send 0s or 1s as the end frame, or omit the end frame?! ¯\_(ツ)_/¯ There's also typo in the |
Actually no. Omitting the end frame causes the next |
It's interesting that FastLED's APA102 implementation appears to send 0xFF000000 for every 32 LED's in the strip as the end frame. This seems to make some sense as this will 'turn off' any LED's in the event that the number of LED's don't fall on a neat boundary - or if sync is somehow lost? (Guessing here!) It also ensures that the clock is toggled sufficiently in the way that Tim identified in his "Understanding the APA102 Superled" blog post that you referred to. |
Closing due to inactivity. |
I just installed micropython:
MicroPython v1.8.7-7-gb5a1a20a3 on 2017-01-09; ESP module with ESP8266
onto my NodeMCU.
I tried the example code for APA102 driver at: https://docs.micropython.org/en/latest/esp8266/esp8266/quickref.html#apa102-driver
whenever I call the write()-method, the LED that comes after the nth led configured with
apa = APA102(clock, data, n)
will light up white.for example:
will result in a red first LED and a white third LED. The second LED stays off.
Any Ideas what could happen here?
Thanks in advance
The text was updated successfully, but these errors were encountered: