TinyPico with the "DotStar" (APA102) #7440
Unanswered
espruino-discuss3
asked this question in
ESP32
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2021-08-03 by undecided
Picked up a couple of the TinyPICO V2 (USB-C variant) boards and, of course, the first thing I did was flashed the ESP32 version of Espruino onto it. I did try the micropython, but I found the wifi to be a bit flaky, whereas I had no problem in Espruino.
It does show one error on boot though:
... but that hasn't bothered me so far. And I'm aware that the bluetooth support isn't there yet, but again, that's not something I plan to use it for yet.
What did bother me was the onboard "LED" (the DotStar, or APA102). Couldn't get that working at all, and since I've never done anything with SPI, I presumed it was me.
Anyway, I fixed it, then I lost the settings to fix it - so I thought I'd document it here in case anyone else has the same problem.
Turns out, the thing I was missing from the documentation is that the following is required to activate the LED:
The D13 confused me. The micropython codebase has a comment that I relied on for far too long - if you look at that code for anything, ignore the suggested pins - they are completely false, and I suspect correspond to a pre-production version of the tinypico.
Also note that in the micropython version, MISO is set to a non-dotstar-specific SPI pin. I believe this is for chaining, so that you can talk to 2 or more of these efficiently, but not something I needed to do.
Once that's set up, you can just write to it - for example:
(Of course, you SHOULD use a Uint8Array... and be a bit more consistent with whether you're using hex or decimals... but for testing it out, this works beautifully)
Hope that helps someone (and if not, it will probably help me when I forget where I saved my current code again!)
Beta Was this translation helpful? Give feedback.
All reactions