I currently working on Intel Edison, and have Grove Air Quality Sensor v1.1
Downloading the source, and install to Arduino library(Arduino IDEdownloaded from intel). Open the example, start Verify. And errors:
It seems that IDE doesn’t know about the function: ISR(TIMER2_OVF_vect).
I googled it and found it, it’s a kind of interrupt, and the source is just make sure every 2 seconds update the value.
So I rewrote this part using loop, delay 0.1 seconds and update every 20 times. But compiler reports:
So I commented out them, and recompile, finally it works!
Guys, can you run the examples without modification?
In the example source, it called airqualitysensor.init(14); in setup(). So this sensor should be connected to A0.
But AirQuality.cpp’s void AirQuality::init(int pin) function is built-in first_vol=analogRead(A0);//initialize first value which means it just read A0 even if you set to A1 pin.
This should not a problem, due to the value would be changed after 2 seconds(why 122 means 2 seconds?)
And why use interrupts to update the value?