It all began, as many things do, with a Tweet. @GeekMomProjects (aka Debra) posted this, late one evening in my timezone.
(sidenote, she has a really good blog and Twitter feed, especially if you are into hardware projects)...
Let's break this down. This is an Espressif ESP32-C3FH4 board with USB-C, covered in 25 multicoloured LEDs (WS2812b / NeoPixels) in a 5x5 grid. The ESP32-C3FH4 is equipped with wifi and Bluetooth LE, 400Kb of SRAM and 4Mb of Flash memory. All in all, it is almost exactly 2cm square. Basically, it's a very capable little microcontroller board, for about $10.
(quite a few other folks in the community also saw the original Tweet, and jumped in on the excitement!)
Getting started
The board arrived within about 10 days (if you order right now delivery is likely to vary, with the Lunar New Year). Plugging it in to a USB port immediately resulted in a fun and colourful cycling light display.
That repo is fine, and folks quickly got building things in the Arduino environment - see this excellent Wordle example from @ciro... with Twitter API, for bonus points!
To flash MicroPython to the board, I needed to hold the button marked B (top left, looking at the back of the board with USB-C on the top edge) when connecting it to my machine. The blue light on the back of the board lit up, and a new USB device showed up. On my M1 Pro MacBook, depending on which side I plugged in to, it was either /dev/tty.usbmodem11301 or /dev/tty.usbmodem21301 (I resorted to ls -lrt /dev to figure this out). Then, I used esptool.py to wipe the board, and reflash with the MicroPython build.
Looking at the Arduino code, the NeoPixels are controlled via pin 8, and there are 25 of them; so in the REPL, this sequence let me initialize the board to talk to the NeoPixels.
importesp32frommachineimportPinfromneopixelimportNeoPixelpin=Pin(8,Pin.OUT)# NP control on Pin 8
pixels=25# we have 25 pixels, set here to use for loops
np=NeoPixel(pin,pixels)
As an aside here, I'm using the Thonny editor to do the editing, but you could use VS Code, mu, or an alternative of your choice. Thonny lets me access the REPL easily, but I could do the same using one of several terminal tools.
The next thing I wanted to do was to understand the board layout. How are the LEDs arranged? By lighting each one in sequence, it was easy to figure this out. Here's the answer.
np[0]=(0,255,0)# top left green
np.write()np[2]=(0,255,0)# top middle green
np.write()np[4]=(255,0,0)# top right red
np.write()np[24]=(255,0,255)# bottom right magenta
np.write()
If the board is aligned with the USB-C / power in along the top edge, the LEDs run from 0 (top left), left to right in rows, down to the last one 24 (bottom right). Here's a visual guide.
Working with the MicroPython developers via Tweets and GitHub issues and commit comments, we eventually figured out the problem with the first pixel staying green. To fix this, I needed to add a specific call at the start of the MicroPython code:
esp32.RMT.bitstream_channel(0)
The ESP32 C3 seems to require the RMT channel to be set this way (this is associated with a change in the implementation of accessing the NeoPixels in MicroPython). In my case, this code is currently working, on the most recent nightly builds of MicroPython.
Since the manufacturer's content is limited to a YouTube video, and the Arduino code, I've documented various experiments and findings on GitHub in a set of discovery notes.
In my FiveByFive repository you can find an example which will run a simple test - blinking each pixel in turn in a randomised RGB colour tuple, and then displaying a happy smiley face π
This repo started as a set of MicroPython experiments. The goal of this project now, is to aggregate information, and different examples, to enable the community to learn about and use the ESP32-C3FH4-RGB board.
a USB-A to USB-C data cable will not work with USB-C to USB-C
Contents
arduino/ updated version of the original Arduino code for the board (may need to populate via git pull --recurse-submodules). This pulls in my fork of the upstream original project so that I can send updates as needed.
micropython/ MicroPython code examples, and board definition for building your own MicroPython firmware.
I've got more ideas in mind than a simple example like this, the board is capable of a lot more. I'm still learning the MicroPython tooling though (I've used CircuitPython before, but rarely MicroPython itself). Stay tuned for more experiments and discoveries, and let me know in the comments if you have any questions or suggestions!