Skip to content

docs(mch2022): document addressable LEDs on an SAO - #254

Merged
annejan merged 2 commits into
masterfrom
mch2022-sao-ws2812-example
Aug 14, 2026
Merged

docs(mch2022): document addressable LEDs on an SAO#254
annejan merged 2 commits into
masterfrom
mch2022-sao-ws2812-example

Conversation

@annejan

@annejan annejan commented Aug 14, 2026

Copy link
Copy Markdown
Member

Closes #91.

The issue asked for the tilde SAO test app as an example. It needed a
place to live, so this adds the missing half of the WS2812 page.

The gap

The page covered only the badge's own five kite LEDs, driven by the ESP32
through the ws2812 component. LEDs on an add-on take a different path:
the chain hangs off SAO_IO0 (pin 5 of the SAO connector), which belongs
to the RP2040, so that component cannot reach them. The ESP32 asks the
RP2040 to shift the data out, over the same I2C link it uses for buttons.

What the page says now

  • The set-up sequence — rp2040_set_gpio_dir, rp2040_set_ws2812_mode,
    rp2040_set_ws2812_length — and the write-then-rp2040_ws2812_trigger
    pattern.
  • The word layout: GRB, green in bits 31-24, red 23-16, blue 15-8, low
    byte for the white channel of RGBW parts.
  • The limits: 10 LEDs maximum, RP2040 firmware version 9 or newer.
  • renzenicolai/mch2022-tilde-ws2812-sao-test-app
    as the worked example, with a sentence on what it actually does.
  • A warning that mode 2 (RGBW) does not work: the RP2040 firmware's
    switch falls through from case 0x02 into ws2812_disable(), so the
    LEDs go dark. Worth a one-line fix upstream in
    mch2022-firmware-rp2040/i2c_peripheral.c.

Sources: esp32-component-mch2022-rp2040 (rp2040.c, include/rp2040.h),
mch2022-firmware-rp2040 (hardware.h, ws2812.c, i2c_peripheral.c)
and the example app.

Checks

hugo --gc --minify clean; both external links return 200; the internal
link to the SAO standard page resolves.

🤖 Generated with Claude Code

https://claude.ai/code/session_0142DuVFXpWnjeQhZzT3N3nC

annejan and others added 2 commits August 14, 2026 22:50
Closes #91.

The WS2812 page only covered the badge's own five kite LEDs, which the
ESP32 drives through the ws2812 component. LEDs on an add-on are a
different path: the chain hangs off SAO IO0, which belongs to the RP2040,
so the component does not reach them and the ESP32 has to ask the RP2040
over I2C instead.

The page now has that path: the set-up calls (gpio direction, mode,
length), the write-and-trigger pattern, the GRB word layout, the ten-LED
limit and the RP2040 firmware version it needs. It links Renze's
mch2022-tilde-ws2812-sao-test-app as the worked example, which is what
the issue asked for.

It also warns that mode 2, the RGBW mode, does not work: the RP2040
firmware's switch falls through from that case into ws2812_disable(), so
the LEDs go dark.

Facts come from esp32-component-mch2022-rp2040 (rp2040.c, rp2040.h),
mch2022-firmware-rp2040 (hardware.h, ws2812.c, i2c_peripheral.c) and the
example app itself.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0142DuVFXpWnjeQhZzT3N3nC
"A worked example" is jargon; the section points at an app, so name it
that.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0142DuVFXpWnjeQhZzT3N3nC
@annejan
annejan merged commit 1a03884 into master Aug 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add tilde test app as example for sao

1 participant