Closed matthewlai closed 2 years ago
Should be able to do this by calling setClock
on the Wire instance used. Ex:
#include <Adafruit_ADS1X15.h>
Adafruit_ADS1115 ads;
void setup() {
Wire.setClock(400000);
ads.begin();
}
void loop() {
}
Wouldn't the speed be overwritten when Adafruit_I2CDevice::begin() calls Wire::begin()? https://github.com/adafruit/Adafruit_BusIO/blob/512fde07b58fc99cef7a90c1b3e682a13738eee7/Adafruit_I2CDevice.cpp#L29
I'm not too familiar with Arduino. If it doesn't and you feel that's a better way, feel free to close this :).
ads.begin(); Wire.setClock(400000);
would work jsut fine - its probably a better way
That does seem like a cleaner way, given the speed is a property of the bus not the device. I'll close this.
Added support for 400 kHz (fast mode) I2C since 100 kHz I2C is the bottleneck for fast conversions.