我想知道是否有人可以帮助我?
我有一个 5M 的 LED 条(300 个 LED)并在我的 ESP32 上运行以下代码。该代码将使 LED 灯旋转!
void spinningwheel(){
int random_number;
int spin_speed;
for(int i =0; i < 1; i++){
random_number = random(NUM_LEDS);
}
Serial.println(random_number);
for (int i = 0; i <= random(6,15); i++){
spin_speed = i+1;
for (int i = 0; i <= NUM_LEDS; i++){
leds[i] = CRGB ( 0, 0, 255);
leds[i-10] = CRGB ( 0, 0, 0);
FastLED.show();
delay(spin_speed);
}
FastLED.clear();
}
for (int i = 0; i <= random_number; i++){
leds[i] = CRGB ( 0, 0, 255);
leds[i-10] = CRGB ( 0, 0, 0);
FastLED.show();
delay(spin_speed);
}
FastLED.clear();
delay(1000);
}
如果我使用,代码工作正常leds[i-3] = CRGB ( 0, 0, 0);
但是当我将数字更改i-3
为类似i-10
ill 在我的串行端口中出现错误时
15:51:36.233 -> 258
15:51:36.267 -> Guru Meditation Error: Core 1 panic'ed (StoreProhibited).
Exception was unhandled.
15:51:36.335 -> Core 1 register dump:
15:51:36.368 -> PC : 0x400d12ae PS : 0x00060930 A0 :
0x800d1658 A1 : 0x3ffb1e80
15:51:36.469 -> A2 : 0x3ffc0124 A3 : 0x3ffb1ea4 A4 :
0x3ffc04bc A5 : 0x3ffb1eb0
15:51:36.571 -> A6 : 0x00000000 A7 : 0x3ffb0060 A8 :
0x00000000 A9 : 0x3ffb1e40
15:51:36.639 -> A10 : 0x00000001 A11 : 0x00000000 A12 :
0x3ffb8570 A13 : 0x00000000
15:51:36.742 -> A14 : 0x3ffb8528 A15 : 0x00000000 SAR :
0x00000020 EXCCAUSE: 0x0000001d
15:51:36.843 -> EXCVADDR: 0x00000000 LBEG : 0x400d0dfd LEND :
0x400d0e0c LCOUNT : 0x00000000
15:51:36.944 ->
15:51:36.944 -> Backtrace: 0x400d12ae:0x3ffb1e80 0x400d1655:0x3ffb1ea0
0x400d1741:0x3ffb1ee0 0x400d0ee0:0x3ffb1f20 0x400d0fe1:0x3ffb1f40
0x400d115e:0x3ffb1f70 0x400d118f:0x3ffb1f90 0x400d216d:0x3ffb1fb0
0x40088215:0x3ffb1fd0
15:51:37.147 ->
15:51:37.147 -> Rebooting...
15:51:37.180 -> :⸮⸮⸮⸮L⸮⸮1⸮m֊⸮1
HL⸮⸮b⸮⸮⸮
错误解码
PC: 0x400d12ae: ClocklessController14, 60, 150, 90, (EOrder)66, 0, false,
5>::showPixels(PixelController(EOrder)66, 1, 4294967295u>&) at
D:\Documenten\Arduino\libraries\FastLED/controller.h line 178
EXCVADDR: 0x00000000
Decoding stack results
0x400d12ae: ClocklessController14, 60, 150, 90, (EOrder)66, 0, false,
5>::showPixels(PixelController(EOrder)66, 1, 4294967295u>&) at
D:\Documenten\Arduino\libraries\FastLED/controller.h line 178
0x400d1655: CPixelLEDController(EOrder)66, 1, 4294967295u>::show(CRGB const*,
int, CRGB) at D:\Documenten\Arduino\libraries\FastLED/controller.h line 408
0x400d1741: CFastLED::show(unsigned char) at
D:\Documenten\Arduino\libraries\FastLED/controller.h line 90
0x400d0ee0: CFastLED::show() at
D:\Documenten\Arduino\libraries\FastLED/FastLED.h line 500
0x400d0fe1: spinningwheel() at
D:\Documenten\Arduino\Ledstrip_wave/Ledstrip_wave.ino line 48
0x400d115e: Binair_buttons() at
D:\Documenten\Arduino\Ledstrip_wave/Ledstrip_wave.ino line 125
0x400d118f: loop() at D:\Documenten\Arduino\Ledstrip_wave/Ledstrip_wave.ino
line 141
0x400d216d: loopTask(void*) at
C:\Users\....\AppData\Local\Arduino15\packages\esp32\
hardware\esp32\1.0.4\cores\esp32\main.cpp line 19
0x40088215: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-
builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c line 143
有人可以解释一下我做错了什么吗?或者我是否通过了最大 RAM 或 CPU 使用率。