Documentation of lib commands ah10 and tc9548a

Forgot to enter my script.

/* Jim Moroz's attempt to combine mux and AHT examples. program TCA and AHT V6.ino

copied and pasted from the library examples code from:

  1. BasicUaageini from the TCA9548A

  2. adafruit_aht10_testlib from the Adafruit AHT10

My compile error:

*/

#include "TCA9548A.h" // Lib for mux

#include <Adafruit_AHT10> // Lib for AHT10

TCA9548A I2CMux; // Address can be passed into the constructor

I2CMux = 0x07

Adafruit_AHT10 aht; //aht is an object of type Adafruit_AHTX0. Adafruit_AHTX0 is a class declared by the "Adafruit AHTX0" library

void setup() {

Serial.begin(9600); //from the TCA9548A example which conflicts with the AHT10 example

// IGNORED: Wire.setPins(21, 22); // ESP32 users, use setPins(sda, scl) if customised, before passing Wire to the library (the line below).

I2CMux.begin(Wire); // Wire instance is passed to the library

I2CMux.closeAll(); // Set a base state which we know (also the default state on power on)

}

void loop()

{

I2CMux.openChannel(0);

/* Code to interactive with revealed address on bus */

sensors_event_t humidity, temp;

aht.getEvent(&humidity, &temp);// populate temp and humidity objects with fresh data

Serial.println("Chan 0 Temperature: "); Serial.println(temp.temperature); Serial.println(" degrees C");

Serial.println("Chan 0 Humidity: "); Serial.println(humidity.relative_humidity); Serial.println("% rH");

I2CMux.closeChannel(0);

I2CMux.openChannel(1);

sensors_event_t humidity, temp;

aht.getEvent(&humidity, &temp);// populate temp and humidity objects with fresh data

Serial.println("Chan 1 Temperature: "); Serial.println(temp.temperature); Serial.println(" degrees C");

Serial.println("Chan 1 Humidity: "); Serial.println(humidity.relative_humidity); Serial.println("% rH");

I2CMux.closeChannel(1);

Delay (500);

}