0

我用 ws2812b LED 构建了一个 LED 矩阵。它由 arduino nano 驱动。我将 CLED 库与 FastLED 结合使用。它工作正常!

现在我在这里有一个非常简单的例程,尽管没有错误或警告,但它不起作用。

问题似乎是我要激活的 LED 路径的阵列。那么我错过了什么?当我在 arduino 上激活它时,它会冻结。该getRandomColorValue()函数只返回一个颜色值 0-255。那个工作就像一个魅力。

int outlinePath[] = {30, 31, 29, 28, 27, 26, 26, 42, 43, 44, 45, 46, 25, 9, 8, 0, 1, 2, 4, 3, 16, 17, 56, 57, 91, 92, 101, 102, 111, 112, 121, 122, 162, 192, 193, 229, 230, 262, 263, 274, 275, 276,   277, 270, 269, 254, 239, 240, 241, 242, 243, 244, 253, 252, 251, 250, 249, 211, 210, 176, 177, 178, 179, 175, 161, 152, 151, 142, 141, 132, 131, 77, 72, 73, 74, 75, 76, 37, 31};
FastLED.clear();

for (int i = 0; i < 70; i++) {
    int test = outlinePath[i];
    leds.m_LED[test] = CRGB(getRandomColorValue(), getRandomColorValue(), getRandomColorValue());
}

FastLED.show();
delay(1000);

这个效果很好:

void progFastBlingBling() {
    FastLED.clear();
    leds.m_LED[random(0, anz_LEDs)] = CRGB(getRandomColorValue(), getRandomColorValue(), getRandomColorValue());
    FastLED.show();
}
4

0 回答 0