adafruit / Adafruit_ADS1X15

Driver for TI's ADS1015: 12-bit Differential or Single-Ended ADC with PGA and Comparator
Other
289 stars 301 forks source link

ESP32 Using Adafruit_ADS1115 whith Two I2C Bus Interfaces #48

Closed nusatiy closed 3 years ago

nusatiy commented 4 years ago

Hello friends. Could you explain how this works when used?

include

include

include

define SDA_1 27

define SCL_1 26

define SDA_2 33

define SCL_2 32

TwoWire I2Cone = TwoWire (0); TwoWire I2Ctwo = TwoWire (1);

How do I tell the Adafruit ADS1115 library that I need to use the second twoWire (1) bus?

I tried pointing as Adafruit_ADS1115 ads1115 (& I2Ctwo); This does not work.

caternuson commented 3 years ago

Pass the bus in when you call begin(). This is a recent change added with #58.