I agree with Koepel
however, what the OP is asking is how to use two LCD in two different I2C busses, we can assume that both LCDs have the same address making it to need two different I2C busses
juanpdl: the problem is that the "LiquidCrystal_I2C" library is defaulted to the main I2C bus, to change that you need to modify the "LiquidCrystal_I2C" library
LiquidCrystal_I2C::LiquidCrystal_I2C(uint8_t lcd_Addr,uint8_t lcd_cols,uint8_t lcd_rows)
{
_Addr = lcd_Addr;
_cols = lcd_cols;
_rows = lcd_rows;
_backlightval = LCD_NOBACKLIGHT;
}
and here
void LiquidCrystal_I2C::expanderWrite(uint8_t _data){
Wire.beginTransmission(_Addr);
printIIC((int)(_data) | _backlightval);
Wire.endTransmission();
}
and if that wasn't enough you need to modify the "wire" library to be able to create two different objects (this may need to rewrite the whole library) starting here
TwoWire Wire = TwoWire();
and becasue as you noticed none of this changes actually tells what pins to use for the busses, you also need to modify the "twi" library at least here
void twi_init(void)
{
// initialize state
twi_state = TWI_READY;
twi_sendStop = true; // default value
twi_inRepStart = false;
// activate internal pullups for twi.
digitalWrite(SDA, 1);
digitalWrite(SCL, 1);
// initialize twi prescaler and bit rate
cbi(TWSR, TWPS0);
cbi(TWSR, TWPS1);
TWBR = ((F_CPU / TWI_FREQ) - 16) / 2;
/* twi bit rate formula from atmega128 manual pg 204
SCL Frequency = CPU Clock Frequency / (16 + (2 * TWBR))
note: TWBR should be 10 or higher for master mode
It is 72 for a 16mhz Wiring board with 100kHz TWI */
// enable twi module, acks, and twi interrupt
TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWEA);
}
and here
void twi_disable(void)
{
// disable twi module, acks, and twi interrupt
TWCR &= ~(_BV(TWEN) | _BV(TWIE) | _BV(TWEA));
// deactivate internal pullups for twi.
digitalWrite(SDA, 0);
digitalWrite(SCL, 0);
}
but as you can see SDA and SCL are not defined anywhere here, so you need to make sure they match the naming from the esp variant "pins_arduino.h"
#define PIN_WIRE_SDA (2)
#define PIN_WIRE_SCL (3)
static const uint8_t SDA = PIN_WIRE_SDA;
static const uint8_t SCL = PIN_WIRE_SCL;
the question here is: is it really worth it?