0

我的 arduino nano 驱动一个 LED 矩阵。一切工作正常。但是我的“大纲路径”对于 SRAM 来说太大了,所以我尝试将它放入 PROGMEM。现在从这个程序数组中读取值会导致完全错误的整数。我究竟做错了什么?

谢谢你的帮助!!

再见安德烈

void progStarsWarp() {

const static PROGMEM int outlinePath[] = {30, 31, 29, 28, 27, 26, 36, 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};
int *pointerOutlinePath;

FastLED.clear();

for (unsigned int i = 0; i < 79; i++) {
    pointerOutlinePath = &outlinePath[i];
    int test = pgm_read_word(pointerOutlinePath);
    leds.m_LED[outlinePath[test]] = CRGB(getRandomColorValue(), getRandomColorValue(), getRandomColorValue());
}

FastLED.show();
delay(60000);

}

4

0 回答 0