Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
Tips:
For a full reference visit the Markdown syntax.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
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!)