  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  * 
- * Slot: C: Weather Click  
+ * Slot: C: Weather Click
+ * Slot: D: Air Quality 4 Click
  * 
  ***************************************************************************/
 

//  tmp116_init();
}

void loop()
{
//  double temp = TMP116_ReadTempSensor();

//    }
//  }

	if (has_bme) {
		bme_read();
	}

	if (has_sgp) {
		sgp_read();
	}

	counter++;
	if (counter == 100) {
		counter = 10;
	}

	delay(5000); // wait 5 seconds for the next I2C scan
}

void bme_init() {
	if (! bme.begin(0x76, &Wire)) {
		Serial.println("BME280: Sensor not found!:#");
		has_bme=false;
	}  
}

void bme_read() {
	bme.takeForcedMeasurement(); // has no effect in normal mode
	Serial.print("MIKROESAM3X_WC:");
	Serial.print(counter);
	Serial.print(":Temp:");
	bme_temperature = bme.readTemperature();
	float bme_temp_f = ((bme_temperature * 1.8) + 32);
	Serial.print(bme_temp_f);
	Serial.print("F:Press:");
	Serial.print(bme.readPressure() / 100.0F);
	Serial.print("mB:Humidity:");
	bme_humidty = bme.readHumidity();
	Serial.print(bme_humidty);
	Serial.println("%:#");
}

void sgp_init() {
	if (! sgp.begin()) {
		Serial.println("SGP30: Sensor not found!:#");
        has_sgp=false;
    }
	Serial.print("Found SGP30 serial #");
	Serial.print(sgp.serialnumber[0], HEX);
	Serial.print(sgp.serialnumber[1], HEX);
	Serial.print(sgp.serialnumber[2], HEX);
	Serial.println(":#");
}

void sgp_read() {
	// If you have a temperature / humidity sensor, you can set the absolute humidity to enable the humditiy compensation for the air quality signals
	//float bme_temperature = 22.1; // [°C]
	//float bme_humidty = 45.2; // [%RH]
	if (has_bme) {
		sgp.setHumidity(getAbsoluteHumidity(bme_temperature, bme_humidty));
	}

	Serial.print("TVOC "); Serial.print(sgp.TVOC); Serial.print(" ppb\t");
	Serial.print("eCO2 "); Serial.print(sgp.eCO2); Serial.println(" ppm");

	if (! sgp.IAQmeasureRaw()) {
		Serial.println("Raw Measurement failed");
		return;
	}
	Serial.print("Raw H2 "); Serial.print(sgp.rawH2); Serial.print(" \t");
	Serial.print("Raw Ethanol "); Serial.print(sgp.rawEthanol); Serial.println("");
	
	delay(1000);

	counter_sgp++;
	if (counter_sgp == 30) {
		counter_sgp = 0;

		uint16_t TVOC_base, eCO2_base;
		if (! sgp.getIAQBaseline(&eCO2_base, &TVOC_base)) {
			Serial.println("Failed to get baseline readings");
			return;
		}
		Serial.print("****Baseline values: eCO2: 0x"); Serial.print(eCO2_base, HEX);
		Serial.print(" & TVOC: 0x"); Serial.println(TVOC_base, HEX);
	}
}

void thunder_init()
