I'm trying to connect three ic2 Oled 128x64 displays to my Arduino mega to display real-time values from three 4-20ma sensors I have wired to the board. I've used the Adafruit SDD1306 driver in the past for one display but all I've seen for running more than one display is one forum post using the U8g2 library and the code was in fragments. If anyone can show me how to connect and write to all three displays and explain how to define the pins for SCL and SDA for each screen that would be much appreciated!
Thanks for the support!
i2c devices all use the same SCL and SDA pins. They connect in parallel.
What is different between them is the address.
However, you may have to solder some pads together on the back of the display board to change the address as they all have a pretty standard address by default.
You will need to check the datasheet / user guide for whatever display you're using to see how to change the address so that all three devices have unique addresses.
I don't know how easy it is to switch that address being used by your display library.
In your code you'll set the address to address 1, render, then switch to address 2 and render, etc.