remember which devices were scanned on which bus and set them accordingly.
This commit is contained in:
1 parent
7a67388a97
commit
861ded37db
23 files changed
+177
-119
No files matched your search
@@ -14,7 +14,18 @@ int32_t SHTC3Sensor::runOnce() {
|
||||
if (!hasSensor()) {
|
||||
return DEFAULT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS;
|
||||
}
|
||||
status = shtc3.begin();
|
||||
if (i2cScanMap[SHTC3_ADDR].addr == 0) {
|
||||
DEBUG_MSG("SHTC3 not found on i2c bus\n");
|
||||
return DEFAULT_SENSOR_MINIMUM_WAIT_TIME_BETWEEN_READS;
|
||||
}
|
||||
if(i2cScanMap[SHTC3_ADDR].bus == 1) {
|
||||
#ifdef I2C_SDA1
|
||||
status = shtc3.begin(&Wire1);
|
||||
#endif
|
||||
} else {
|
||||
status = shtc3.begin(&Wire);
|
||||
}
|
||||
|
||||
return initI2CSensor();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user