Files
led-controller/scripts/led-test/main/main.c
T
jimmyandClaude Sonnet 5.5 71bd320661 feat(v2): move web UI into v2, remove legacy MicroPython app
Move the web assets and templates under v2/web, drop the old src/, lib/
and scripts, and update firmware, tools, docs and db files. Add the audio
page, LED test scripts and VPN autoconnect script.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-02 20:30:02 +13:00

30 lines
999 B
C

// Steady WS2812 signal on GPIO 10 for probing with a meter: the first 10 LEDs green, a frame
// every 20 ms so the pin never idles. The data pin should read roughly 0.3-1 V DC against GND.
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "led_strip.h"
#include "esp_log.h"
#define LED_GPIO 10
#define NUM_LEDS 200
#define LIT 10
static const char *TAG = "led_test";
void app_main(void)
{
led_strip_handle_t strip;
led_strip_config_t cfg = { .strip_gpio_num = LED_GPIO, .max_leds = NUM_LEDS };
led_strip_rmt_config_t rmt = { .resolution_hz = 10 * 1000 * 1000 };
ESP_ERROR_CHECK(led_strip_new_rmt_device(&cfg, &rmt, &strip));
for (int i = 0; i < LIT; i++)
led_strip_set_pixel(strip, i, 0, 120, 0);
ESP_LOGI(TAG, "sending to GPIO %d continuously", LED_GPIO);
for (unsigned n = 0;; n++) {
led_strip_refresh(strip);
if (n % 250 == 0)
ESP_LOGI(TAG, "frames sent: %u", n);
vTaskDelay(pdMS_TO_TICKS(20));
}
}