Skip to content

Commit 7636a64

Browse files
authored
Merge pull request #473 from tyeth/add-DHT20
Add DHT20 as alias of AHTx0
2 parents e7f40ca + bf0c049 commit 7636a64

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/i2c/WipperSnapper_I2C.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,8 @@ bool WipperSnapper_Component_I2C::initI2CDevice(
216216
WS_DEBUG_PRINTLN(msgDeviceInitReq->i2c_device_name);
217217

218218
uint16_t i2cAddress = (uint16_t)msgDeviceInitReq->i2c_device_address;
219-
if (strcmp("aht20", msgDeviceInitReq->i2c_device_name) == 0) {
219+
if ((strcmp("aht20", msgDeviceInitReq->i2c_device_name) == 0) ||
220+
(strcmp("dht20", msgDeviceInitReq->i2c_device_name) == 0)) {
220221
_ahtx0 = new WipperSnapper_I2C_Driver_AHTX0(this->_i2c, i2cAddress);
221222
if (!_ahtx0->begin()) {
222223
WS_DEBUG_PRINTLN("ERROR: Failed to initialize AHTX0 chip!");

0 commit comments

Comments
 (0)