Use two MCP4728 DACs with the same Arduino MEGA

Hello everyone,

I'm new to Arduino and would love to know if there's a way to control two MCP4728 DACs individually from my Arduino MEGA.
As backgroung I'll add that I'm using this code as a base for my project: GitHub - hideakitai/MCP4728: Arduino library for MCP4728 quad channel, 12-bit voltage output Digital-to-Analog Convertor with non-volatile memory and I2C compatible Serial Interface.
I'm working on a current control circuit for solenoids (8 of them, thus 2 DACs), the DAC is controling a FET gate and the Arduino is reading back the actual current as feedback.

Is there an elegant solution or will I need 2 Arduino controllers?

Thank you!!

According to the data sheet for the MCP4728, you can configure these devices with different I2C addresses. Standard is 0b1100000 (seven bit address) but you can set the last 3 bits.
That means you could have up to 8 of these devices on the same I2C bus.

Thank you very much 6v6gt!

I would still need some more help with that.

I understand how I2C works and I understood what you meant by the last 3 bits, but it's my first Arduino project ever and I'm using a built code (link in the first message).

In this code they use some MCP4728 DAC object "ready" key words like "dac.analogWrite(...)". how can I control the last 3 bits to send data to 2 different MCP chips?

lots of thanks!