Hi, i am trying to write a code using https://software.intel.com/en-us/iot/hardware/sensors/grove-air-quality-sensor Intel Sample for Grove TP401 GAS Sensor and as hardware also the https://learn.sparkfun.com/tutorials/sparkfun-blocks-for-intel-edison---adc-v20 SparkFun ADC Block which works on I2C. I see that SparkFun Block has a https://github.com/sparkfun/SparkFun_ADC_Block_for_Edison_CPP_Library Lib.
Any help would be appreciated - sorry for stupid questions, i am a beginner.
You don't have to use the library to use the ADC block, however, using it will make you the things easier. I recommend you to use the resources that SparkFun offers for the ADC block.
In the link you posted, there is an example for the ADC block. The example shows how to read data from channels 0 and 1. I recommend you to check it.
Yes but my Sensor is on AIO not I2C Protocol so the sensor lib has to be write again, in order to use it with the block lib. And also, what should be the equivalent PIN for AIN0 and AIN1 (channels) - if i don't use the lib?
Also if I want to use SparFun Lib, i will have to write the Gas sensor lib again to use I2C Protocol instead of AIO?
The sensor code has been written based on the Arduino Expansion Board for Edison. Since you are not using it, you don't need that library. You are using the ADC block from SparkFun so I recommend you to use the library they provide.
Basically, both, the sensor library and the SparkFun library, do the same: read from the analog input. That's the only thing you need.
The I2C protocol is used to interface the ADC block with the Edison module, however, you don't have to do anything with I2C. The initialization of the I2C protocol is managed by the SparkFun library, you only need to use the methods of getting the analog values, for example adc.getRawResult(0) that reads the raw value from channel 0.
So this is my suggestion: