fix i2c scanning eror for Arduino (#2364)

This commit is contained in:
Martin authored and GitHub committed 2021-09-22 19:08:42 +02:00
1 parent 0406e27100
commit 262d69308d
2 files changed
+4 -5

No files matched your search

+2 -3
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++;
+2 -2
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);