From 8da09d4959e84f34496af418270a0ac474f4a9f9 Mon Sep 17 00:00:00 2001 From: Niklas Jensen Date: Tue, 2 Dec 2025 15:29:05 +0100 Subject: [PATCH] Fixed frequency of I2C to work with servo controller --- esp32/include/settings/peripherals_settings.h | 2 +- esp32/src/peripherals/peripherals.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/esp32/include/settings/peripherals_settings.h b/esp32/include/settings/peripherals_settings.h index 6947b7a..a073196 100644 --- a/esp32/include/settings/peripherals_settings.h +++ b/esp32/include/settings/peripherals_settings.h @@ -15,7 +15,7 @@ #define SCL_PIN SCL #endif #ifndef I2C_FREQUENCY -#define I2C_FREQUENCY 1000000UL +#define I2C_FREQUENCY 400000UL #endif class PinConfig { diff --git a/esp32/src/peripherals/peripherals.cpp b/esp32/src/peripherals/peripherals.cpp index 1b5b5c6..0240dec 100644 --- a/esp32/src/peripherals/peripherals.cpp +++ b/esp32/src/peripherals/peripherals.cpp @@ -70,6 +70,7 @@ void Peripherals::updatePins() { if (state().sda != -1 && state().scl != -1) { Wire.begin(state().sda, state().scl, state().frequency); + ESP_LOGI("Peripherals", "Starting Wire with SDA=%d, SCL=%d, FREQ=%d", state().sda, state().scl, state().frequency); i2c_active = true; } }