1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-03 20:02:22 +01:00

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
2 changed files with 4 additions and 5 deletions

View File

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

View File

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