ArduinoFFT library argument list compilation error in Arduino

I am creating a sound visualizer using an arduino nano,electret condenser microphone and 8X32 matrix and i keep getting the same error.

here is the code:

#include <ArduinoFFT.h>
#include <Adafruit_GFX.h>
#include <Adafruit_NeoMatrix.h>
#include <Adafruit_NeoPixel.h>

#define PIN_MATRIX 2 // Arduino Nano Pin D2 to DIN of matrix
#define PIN_MIC 0   // Arduino Nano Analog Pin A0 to microphone Vout
#define MATRIX_WIDTH 32
#define MATRIX_HEIGHT 8
#define MIC_SAMPLE_SIZE 48 // Change according to your mic module's specifications

ArduinoFFT fft;

Adafruit_NeoMatrix matrix = Adafruit_NeoMatrix(MATRIX_WIDTH, MATRIX_HEIGHT, PIN_MATRIX,
  NEO_MATRIX_TOP     + NEO_MATRIX_LEFT +
  NEO_MATRIX_COLUMNS + NEO_MATRIX_ZIGZAG,
  NEO_GRB            + NEO_KHZ800);

void setup() {
  Serial.begin(9600);
  matrix.begin();
  matrix.setTextWrap(false);
  matrix.setBrightness(50); // Adjust brightness as needed
  matrix.setTextColor(matrix.Color(255, 255, 255)); // Text color
  fft.begin(MIC_SAMPLE_SIZE); // Initialize the FFT object
}

void loop() {
  fft.Execute(); // Run FFT

  int max_index = 0;
  int max_value = 0;

  for (int i = 0; i < MIC_SAMPLE_SIZE / 2; i++) {
    int value = fft.Output[i]; // Read FFT result
    if (value > max_value) {
      max_value = value;
      max_index = i;
    }
  }

  // Map max_index to matrix columns
  int column = map(max_index, 0, MIC_SAMPLE_SIZE / 2, 0, MATRIX_WIDTH);

  // Clear matrix
  matrix.fillScreen(0);

  // Draw bar on matrix
  for (int y = 0; y < MATRIX_HEIGHT; y++) {
    matrix.drawPixel(column, y, matrix.Color(255, 255, 255)); // White color
  }

  matrix.show();
}

Here is the error:

/Users/vyomesh/Documents/Arduino/sketch_apr22a/sketch_apr22a.ino:12:1: error: invalid use of template-name 'ArduinoFFT' without an argument list
 ArduinoFFT fft;
 ^~~~~~~~~~
/Users/vyomesh/Documents/Arduino/sketch_apr22a/sketch_apr22a.ino:12:1: note: class template argument deduction is only available with -std=c++1z or -std=gnu++1z
In file included from /Users/vyomesh/Documents/Arduino/sketch_apr22a/sketch_apr22a.ino:1:0:
/Users/vyomesh/Documents/Arduino/libraries/arduinoFFT/src/ArduinoFFT.h:58:29: note: 'template<class T> class ArduinoFFT' declared here
 template <typename T> class ArduinoFFT {
                             ^~~~~~~~~~
/Users/vyomesh/Documents/Arduino/sketch_apr22a/sketch_apr22a.ino: In function 'void setup()':
/Users/vyomesh/Documents/Arduino/sketch_apr22a/sketch_apr22a.ino:25:3: error: 'fft' was not declared in this scope
   fft.begin(MIC_SAMPLE_SIZE); // Initialize the FFT object
   ^~~
/Users/vyomesh/Documents/Arduino/sketch_apr22a/sketch_apr22a.ino:25:3: note: suggested alternative: 'ffs'
   fft.begin(MIC_SAMPLE_SIZE); // Initialize the FFT object
   ^~~
   ffs
/Users/vyomesh/Documents/Arduino/sketch_apr22a/sketch_apr22a.ino: In function 'void loop()':
/Users/vyomesh/Documents/Arduino/sketch_apr22a/sketch_apr22a.ino:29:3: error: 'fft' was not declared in this scope
   fft.Execute(); // Run FFT
   ^~~
/Users/vyomesh/Documents/Arduino/sketch_apr22a/sketch_apr22a.ino:29:3: note: suggested alternative: 'ffs'
   fft.Execute(); // Run FFT
   ^~~
   ffs

exit status 1

Compilation error: invalid use of template-name 'ArduinoFFT' without an argument list

Matrix Wiring:
GND-GND
5V-5V
DIN-D2

Electret condenser michrophone:
Positive- A0 and connected to 5V through resistor
Negative- GND

Other info: Macos sonoma
library name- ArduinoFFT.h

  • Restarted IDE
  • Reinstalled the library
  • tried different versions
  • sought help from ChatGPT as a last resort (still failed)

New contributor

Vyomesh Vasanth is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật