Error Compiling the example for "Grove - Air Quality Sensor v1.3" (Arduino Leonardo - with ATmega32U4)

Dear all.

For this sensor:

I added the library (zip file) from here:

Then I extracted and put it on the libraries.

Then, just when I try to compile the example, I immediately get this msg below.
Do you have an idea about what I am doing wrong?
Could it be something with the library?
Thanks a lot.
Omar Cruz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Arduino: 1.8.10 (Linux), Board: “Arduino Leonardo”

In file included from /home/o/Downloads/arduino-1.8.10/hardware/arduino/avr/cores/arduino/Arduino.h:30:0,
from /home/o/Arduino/libraries/Grove_-Air_quality_sensor/AirQuality.h:23,
from /home/o/Arduino/libraries/Grove
-Air_quality_sensor/examples/AirQuality_Sensor/AirQuality_Sensor.ino:6:
/home/o/Arduino/libraries/Grove
-Air_quality_sensor/examples/AirQuality_Sensor/AirQuality_Sensor.ino: In function ‘void TIMER2_OVF_vect()’:
/home/o/Arduino/libraries/Grove
-_Air_quality_sensor/examples/AirQuality_Sensor/AirQuality_Sensor.ino:30:5: warning: ‘TIMER2_OVF_vect’ appears to be a misspelled ‘signal’ handler, missing '_vector’ prefix [-Wmisspelled-isr]
ISR(TIMER2_OVF_vect)
^
/home/o/Arduino/libraries/Grove
-Air_quality_sensor/AirQuality.cpp: In member function ‘void AirQuality::init(int)’:
/home/o/Arduino/libraries/Grove
-Air_quality_sensor/AirQuality.cpp:80:5: error: ‘TCCR2A’ was not declared in this scope
TCCR2A=0;//normal model
^~~~~~
/home/o/Arduino/libraries/Grove
-Air_quality_sensor/AirQuality.cpp:80:5: note: suggested alternative: ‘TCCR0A’
TCCR2A=0;//normal model
^~~~~~
TCCR0A
/home/o/Arduino/libraries/Grove
-Air_quality_sensor/AirQuality.cpp:81:5: error: ‘TCCR2B’ was not declared in this scope
TCCR2B=0x07;//set clock as 1024*(1/16M)
^~~~~~
/home/o/Arduino/libraries/Grove
-Air_quality_sensor/AirQuality.cpp:81:5: note: suggested alternative: ‘TCCR0B’
TCCR2B=0x07;//set clock as 1024*(1/16M)
^~~~~~
TCCR0B
/home/o/Arduino/libraries/Grove
-Air_quality_sensor/AirQuality.cpp:82:5: error: ‘TIMSK2’ was not declared in this scope
TIMSK2=0x01;//enable overflow interrupt
^~~~~~
/home/o/Arduino/libraries/Grove
-Air_quality_sensor/AirQuality.cpp:82:5: note: suggested alternative: ‘TIMSK0’
TIMSK2=0x01;//enable overflow interrupt
^~~~~~
TIMSK0
Multiple libraries were found for “AirQuality.h”
Used: /home/o/Arduino/libraries/Grove
-_Air_quality_sensor
exit status 1
Error compiling for board Arduino Leonardo.

This report would have more information with
“Show verbose output during compilation”
option enabled in File -> Preferences.

Hi @omarecd, I tried to compile the code and didn’t face any issues.

Please take a look at these:

You added the library multiple time, so go to /home/o/Arduino/libraries/ and remove on of the Grove -_Air_quality_sensor folder and try again.

Hello, I’m having a slightly different issue compiling the air quality sensor example on a Seeeduino XIAO.
Here’s the error it spits out
I’m not at all knowledgable in this sorta stuff, I’m just panicking trying to throw together a school project last minute.

Error
Arduino: 1.8.18 (Windows Store 1.8.55.0) (Windows 10), Board: "Seeeduino XIAO, Arduino, Off"

AirQuality_Sensor:25:5: error: expected constructor, destructor, or type conversion before '(' token

 ISR(TIMER2_OVF_vect)

     ^

AirQuality_Sensor:25:4: error: expected constructor, destructor, or type conversion before '(' token

 ISR(TIMER2_OVF_vect)

    ^

exit status 1

expected constructor, destructor, or type conversion before '(' token



This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Example code
#include"AirQuality.h"
#include"Arduino.h"
AirQuality airqualitysensor;
int current_quality =-1;
void setup()
{
    Serial.begin(9600);
    airqualitysensor.init(A0);
}
void loop()
{
    current_quality=airqualitysensor.slope();
    if (current_quality >= 0)// if a valid data returned.
    {
        if (current_quality==0)
            Serial.println("High pollution! Force signal active");
        else if (current_quality==1)
            Serial.println("High pollution!");
        else if (current_quality==2)
            Serial.println("Low pollution!");
        else if (current_quality ==3)
            Serial.println("Fresh air");
    }
}
ISR(TIMER2_OVF_vect)
{
    if(airqualitysensor.counter==122)//set 2 seconds as a detected duty
    {
        airqualitysensor.last_vol=airqualitysensor.first_vol;
        airqualitysensor.first_vol=analogRead(A0);
        airqualitysensor.counter=0;
        airqualitysensor.timer_index=1;
        PORTB=PORTB^0x20;
    }
    else
    {
        airqualitysensor.counter++;
    }
}