Skip to main content

ESP32-C3FH4-RGB

A tiny ESP32-C3 board with 5x5 LED array.

ESP32-C3FH4-RGB picture

Features

  • I2C on 0/1 using Qwiic connector
  • LED on pin 10 (use setStatusLight to control)
  • Serial logging on pin 21 at 115200 8N1

  • Service: buttonBOOT (button)

Stores

Pins

pin namehardware idfeatures
LEDSGPIO8boot, io
P2GPIO2analogIn, boot, io
P20GPIO20bootUart, io
P3GPIO3analogIn, io
P4GPIO4analogIn, debug, io
P5GPIO5debug, io
P6GPIO6debug, io
P7GPIO7debug, io
$services.buttonBOOT[0].pinGPIO9$services.buttonBOOT[0].pin, boot, io
i2c.pinSCLGPIO1i2c.pinSCL, analogIn, io
i2c.pinSDAGPIO0i2c.pinSDA, analogIn, io
led.pinGPIO10led.pin, io
log.pinTXGPIO21log.pinTX, bootUart, io

DeviceScript import

You must add this import statement to load the pinout configuration for this device.

In Visual Studio Code, click the wand icon on the file menu and select "ESP32-C3FH4-RGB".

import { pins, board } from "@dsboard/esp32_c3fh4_rgb"

Driver

The LEDs can be controlled as a LED strip or a display.

import { Esp32C3FH4RGB } from "@devicescript/drivers"
import { startLedDisplay } from "@devicescript/runtime"

const board = new Esp32C3FH4RGB()
const led = await board.startLed()
await led.intensity.write(0.05)
const display = await startLedDisplay(led)

const n = display.palette.length
let k = 0
for (let y = 0; y < 5; ++y)
for (let x = 0; x < 5; ++x)
await display.image.set(x, y, k++ % n)
await display.show()

Firmware update

In Visual Studio Code, select DeviceScript: Flash Firmware... from the command palette.

Run this command line command and follow the instructions.

devicescript flash --board esp32_c3fh4_rgb

Configuration

esp32_c3fh4_rgb.json
{
"$schema": "https://raw.githubusercontent.com/microsoft/devicescript-esp32/main/boards/esp32deviceconfig.schema.json",
"id": "esp32_c3fh4_rgb",
"devName": "ESP32-C3FH4-RGB",
"productId": "0x3a90885c",
"$description": "A tiny ESP32-C3 board with 5x5 LED array.",
"archId": "esp32c3",
"url": "https://github.com/01Space/ESP32-C3FH4-RGB",
"$services": [
{
"name": "buttonBOOT",
"pin": 9,
"service": "button"
}
],
"i2c": {
"$connector": "Qwiic",
"pinSCL": 1,
"pinSDA": 0
},
"led": {
"isMono": true,
"pin": 10
},
"log": {
"pinTX": 21
},
"pins": {
"LEDS": 8,
"P2": 2,
"P20": 20,
"P3": 3,
"P4": 4,
"P5": 5,
"P6": 6,
"P7": 7
}
}