How to define OLED pins (Arduino Nano)

Hi all,

I am using an 12C OLED screen with an Arduino Nano. By default I wire it up to A4 and A5 but I need to use these pins for another part of the project.

How do I define the pins I want it to use?

Thanks, Zeb

A4 and A5 are shared with SCL and SDA, the I2C lines. You can't add other stuff on there if you want to use the display. There is such a thing as a software I2C that can use other pins, but it's usually an abomination, so let's talk about how you can free up different pins instead. An action that would give us high confidence in knowing your need, would be to post a circuit diagram i.e. schematic.

Hi aarg,

I am wanting to use a MCP4725 I2C DAC and a 12C OLED screen with an Arduino Nano and both modules are meant to be wired to the A4 and A5 pins.

Is there a way to change the default pins for either of these?

I can create a wiring diagram if that would be helpful.

Thanks, Zeb

Will I need to use 2 Arduino boards?

No. I2C is a bus. This means as long as i2c-devices have different adresses you can run them both on the same bus. That's the main reason to use a any kind of bus. Sharing and therethrough saving io-pins.
Best regars Stefan

OK, that's great thank you!

So does that mean if the display is initialized like this

if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C))

And the MCP4725 DAC like this:

MCP4725.begin(0x60);

It should work fine?

Thanks, Zeb

It's working great, thank you all! I am know learning more about how i2C works.

Thanks again, Zeb