src/AHTxx.cpp
/**************************************************************/
/*
  begin()
  Initialize I2C & sensor

  NOTE:
  - call this function before doing anything else!!!
  - speed in Hz, stretch in usec
  - returned value by "Wire.endTransmission()":
    - 0 success
    - 1 data too long to fit in transmit data buffer
    - 2 received NACK on transmit of address
    - 3 received NACK on transmit of data
    - 4 other error
*/
begin()
Initialize I2C & sensor

call this function before doing anything else
speed in Hz, stretch in usec
returned value by "Wire.endTransmission()":
0 success
1 data too long to fit in transmit data buffer
2 received NACK on transmit of address
3 received NACK on transmit of data
4 other error
begin () Initialize I2C & sensor call this function before doing anything else speed in Hz stretch in usec returned value by " Wire . endTransmission () " : 0 success 1 data too long to fit in transmit data buffer 2 received NACK on transmit of address 3 received NACK on transmit of data 4 other error
bool AHTxx::begin () {
  Wire.begin();
  delay(AHT2X_POWER_ON_DELAY);  
  return softReset();          
}
bool AHTxx :: begin ( ) { Wire . begin ( ) ; delay ( AHT2X_POWER_ON_DELAY ) ; return softReset ( ) ; }
begin()
Initialize I2C & sensor
begin () Initialize I2C & sensor
//wait for sensor to initialize //soft reset is recommended at start (reset, set normal mode, set calibration bit & check calibration bit)