kopia lustrzana https://github.com/debsahu/ESP32_FFT_Audio_LEDs
Fix buffer overflow bug in peak array
The peak array is only 7 bytes long, but there are 8 bytes written to it. This overwrites the variable, that the compiler decides to put afterwards, most likely the sample buffer vReal[]. Maybe this is also the reason why you decided to omit the first sample when iterating through vReal[]?pull/1/head
rodzic
da88434ac8
commit
88b43f9cb3
|
@ -19,7 +19,7 @@ arduinoFFT FFT = arduinoFFT();
|
|||
int amplitude = 200;
|
||||
unsigned int sampling_period_us;
|
||||
unsigned long microseconds;
|
||||
byte peak[] = {0, 0, 0, 0, 0, 0, 0};
|
||||
byte peak[] = {0, 0, 0, 0, 0, 0, 0, 0};
|
||||
double vReal[SAMPLES];
|
||||
double vImag[SAMPLES];
|
||||
unsigned long newTime, oldTime;
|
||||
|
@ -114,4 +114,4 @@ void loop()
|
|||
Serial.println();
|
||||
|
||||
ws2812fx.service();
|
||||
}
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue