Xinyuan-LilyGO / T-Display-S3

MIT License
779 stars 193 forks source link

i2c 7 bit address? #227

Closed jaymedavis closed 7 months ago

jaymedavis commented 7 months ago

I have several LILYGO T-Display-S3 ESP32-S3's

I am trying to connect to an Adafruit INA260 (code here, very simple).

When I call !ina260.begin(0x40) (which is the correct i2c address confirmed by an i2cscanner script), it just locks. I traced it down inside that library, and its dying at this line: i2c_dev = new Adafruit_I2CDevice(i2c_address, theWire);

I am using the STEMMA port, sda 43 and scl 44 pins. I could try passing a "7 bit i2c address" to this function, but i can't find anywhere what that address is? I have found lots of documentation saying there is a 7 or 10 bit address for i2c for the ESP32-S3, but nothing tells me what that value is?

Any idea if that's it, or what else might be going on?

jaymedavis commented 7 months ago

I was able to figure this out. See the comments here.

https://github.com/adafruit/Adafruit_SSD1306/issues/260

For this board in particular, you need this code: (43 and 44 are sda/scl for the stemma port)

TwoWire wire = TwoWire(0);
wire.begin(43, 44);