docs(mch2022): document addressable LEDs on an SAO - #254
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
ws2812component. LEDs on an add-on take a different path:the chain hangs off
SAO_IO0(pin 5 of the SAO connector), which belongsto 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
rp2040_set_gpio_dir,rp2040_set_ws2812_mode,rp2040_set_ws2812_length— and the write-then-rp2040_ws2812_triggerpattern.
byte for the white channel of RGBW parts.
renzenicolai/mch2022-tilde-ws2812-sao-test-appas the worked example, with a sentence on what it actually does.
2(RGBW) does not work: the RP2040 firmware'sswitch falls through from
case 0x02intows2812_disable(), so theLEDs 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 --minifyclean; both external links return 200; the internallink to the SAO standard page resolves.
🤖 Generated with Claude Code
https://claude.ai/code/session_0142DuVFXpWnjeQhZzT3N3nC