Adafruit-PWM-Servo-Driver-Library icon indicating copy to clipboard operation
Adafruit-PWM-Servo-Driver-Library copied to clipboard

Resetting of I2C bus speed

Open retostockli opened this issue 8 months ago • 3 comments

I make the experience that the command Adafruit_PWMServoDriver::begin() resets the I2C bus speed to 100 kHz. Is this correct? I can set it again to 400 kHz after the begin, but this is not really nice when having a general I2C parameter and bus definition in a larger program context and having many different I2C devices on the bus.

Would it be possible to leave the I2C bus properties untouched of the Adafruit PWM Servo code?

Cheers Reto

retostockli avatar Apr 01 '25 16:04 retostockli

yeah i dont think it should, do you want to do a PR?

ladyada avatar May 26 '25 22:05 ladyada

I would like to leave it to the developers to confirm the issue and find the solution if possible. However, If you want I can try to analyze where the problem arises in the library, ok?

retostockli avatar May 28 '25 11:05 retostockli

This might be BSP specific? What board are you using?

This library's ::begin() calls begin() on the I2C device: https://github.com/adafruit/Adafruit-PWM-Servo-Driver-Library/blob/73cf3ecc79c7c33a72f8ce1a3d91ca556cd34ab3/Adafruit_PWMServoDriver.cpp#L70 which then just calls the BSP's begin() for Wire: https://github.com/adafruit/Adafruit_BusIO/blob/a09a91d13ecf321befb148e12304777db1633c7a/Adafruit_I2CDevice.cpp#L31

caternuson avatar May 28 '25 15:05 caternuson