Add multi-panel Pico UDP firmware and Python LED control.

Pico panels get static IPs on 10.1.1.10–14 with per-panel LED counts, Makefile deploy targets, and Python examples for animations, sync tests, and direct Pi SPI control.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-28 22:46:08 +12:00
parent d8323bb9a3
commit d5cab2efdf
52 changed files with 4677 additions and 1 deletions

View File

@@ -0,0 +1,39 @@
/* C API wrapper around ForsakenNGS/Pico_WS2812 */
#include "ws2812_led.h"
#include "WS2812.hpp"
#include "hardware/pio.h"
#include "pico/stdlib.h"
static WS2812 *s_strip;
extern "C" void ws2812_init(unsigned int pin, unsigned int num_leds) {
uint sm = pio_claim_unused_sm(pio0, true);
s_strip = new WS2812(pin, num_leds, pio0, sm, WS2812::FORMAT_GRB);
}
extern "C" void ws2812_set_rgb(const uint8_t *rgb, unsigned int count) {
if (s_strip == nullptr || rgb == nullptr) {
return;
}
for (unsigned int i = 0; i < count; i++) {
s_strip->setPixelColor(i, rgb[i * 3 + 0], rgb[i * 3 + 1], rgb[i * 3 + 2]);
}
}
extern "C" void ws2812_fill(uint8_t r, uint8_t g, uint8_t b) {
if (s_strip == nullptr) {
return;
}
s_strip->fill(WS2812::RGB(r, g, b));
}
extern "C" void ws2812_show(void) {
if (s_strip == nullptr) {
return;
}
s_strip->show();
sleep_us(300);
}