Skip to content

Commit

Permalink
Add DHT20 as alias of AHTx0
Browse files Browse the repository at this point in the history
  • Loading branch information
tyeth committed Aug 16, 2023
1 parent d5e9a70 commit ce0f17d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/i2c/WipperSnapper_I2C.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ bool WipperSnapper_Component_I2C::initI2CDevice(
WS_DEBUG_PRINTLN(msgDeviceInitReq->i2c_device_name);

uint16_t i2cAddress = (uint16_t)msgDeviceInitReq->i2c_device_address;
if (strcmp("aht20", msgDeviceInitReq->i2c_device_name) == 0) {
if ((strcmp("aht20", msgDeviceInitReq->i2c_device_name) == 0) ||
(strcmp("dht20", msgDeviceInitReq->i2c_device_name) == 0)) {
_ahtx0 = new WipperSnapper_I2C_Driver_AHTX0(this->_i2c, i2cAddress);
if (!_ahtx0->begin()) {
WS_DEBUG_PRINTLN("ERROR: Failed to initialize AHTX0 chip!");
Expand Down

0 comments on commit ce0f17d

Please sign in to comment.