fix i2c scanning eror for Arduino (#2364)

This commit is contained in:
Martin 2021-09-22 19:08:42 +02:00 committed by GitHub
parent 0406e27100
commit 262d69308d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 5 deletions

View File

@ -33,9 +33,8 @@ void ArduinoI2CBus::dump_config() {
if (this->scan_) { if (this->scan_) {
ESP_LOGI(TAG, "Scanning i2c bus for active devices..."); ESP_LOGI(TAG, "Scanning i2c bus for active devices...");
uint8_t found = 0; uint8_t found = 0;
for (uint8_t address = 1; address < 120; address++) { for (uint8_t address = 8; address < 120; address++) {
auto err = readv(address, nullptr, 0); auto err = writev(address, nullptr, 0);
if (err == ERROR_OK) { if (err == ERROR_OK) {
ESP_LOGI(TAG, "Found i2c device at address 0x%02X", address); ESP_LOGI(TAG, "Found i2c device at address 0x%02X", address);
found++; found++;

View File

@ -43,8 +43,8 @@ void IDFI2CBus::dump_config() {
if (this->scan_) { if (this->scan_) {
ESP_LOGI(TAG, "Scanning i2c bus for active devices..."); ESP_LOGI(TAG, "Scanning i2c bus for active devices...");
uint8_t found = 0; uint8_t found = 0;
for (uint8_t address = 1; address < 120; address++) { for (uint8_t address = 8; address < 120; address++) {
auto err = readv(address, nullptr, 0); auto err = writev(address, nullptr, 0);
if (err == ERROR_OK) { if (err == ERROR_OK) {
ESP_LOGI(TAG, "Found i2c device at address 0x%02X", address); ESP_LOGI(TAG, "Found i2c device at address 0x%02X", address);