I wanted to do this project of a visual balancer with 8x8 LED matrix and sound sensor, but the code doesn't work... Would you help me?
#include <ArduinoFFT.h> // Assicurati di includere la libreria corretta
#include <LedControl.h> // Libreria per controllare il display a matrice
#define DATA_IN 12
#define CLK 11
#define CS 10
ArduinoFFT FFT = ArduinoFFT();
LedControl lc = LedControl(DATA_IN, CLK, CS, 1);
void setup() {
lc.shutdown(0, false);
lc.setIntensity(0, 8);
lc.clearDisplay(0);
Serial.begin(9600);
}
void loop() {
double vReal[128];
double vImag[128];
// Leggi i valori dal sensore sonoro
for (int i = 0; i < 128; i++) {
vReal[i] = analogRead(A2);
vImag[i] = 0;
}
// Esegui l'analisi FFT
FFT.Windowing(vReal, 128, FFT_WIN_TYP_HAMMING, FFT_FORWARD);
FFT.Compute(vReal, vImag, 128, FFT_FORWARD);
FFT.ComplexToMagnitude(vReal, vImag, 128);
// Visualizza l'equalizzatore sul display a matrice
displayEqualizer(vReal);
}
void displayEqualizer(double *vReal) {
lc.clearDisplay(0);
for (int i = 0; i < 8; i++) {
int value = map(vReal[i], 0, 1023, 0, 8);
lc.setRow(0, i, (1 << value) - 1);
}
}
C:------
fatal error: ArduinoFFT.h: No such file or directory
#include <ArduinoFFT.h> // Assicurati di includere la libreria corretta
^~~~~~~~~~~~~~
compilation terminated.
exit status 1
Compilation error: ArduinoFFT.h: No such file or directory