Skip to content

Commit

Permalink
Merge pull request #473 from tyeth/add-DHT20
Browse files Browse the repository at this point in the history
Add DHT20 as alias of AHTx0
  • Loading branch information
brentru authored Aug 28, 2023
2 parents e7f40ca + bf0c049 commit 7636a64
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 7636a64

Please sign in to comment.