Hi there. I am building a data glove and am using a Arduino Mega Pro which is a compact version of the usual Arduino Mega. I am using conductive thread to connect my components to the board as it allows for flexibility for the user as everything is going to be placed onto a glove. As such, I do not want to use header pins but instead tie the thread directly to the board. If you look at the item in the link below, the SDA and SCL pins are directly on top of each other (Pins 20 and 21). However, is there any way to change the location of one of the pins? I want to do this so that it is easier to connect ot and so that there is a lower risk of any of the connections interacting with each other. I am using those pins to connect a 0.96 inch OLED screen. If anyone has any ideas of how to move the pins in the software or even any ideas where I can leave the pins in place and still avoid any issues, please do let me know.
I have the same question and the reason I want to change them is that Pin 2 and 3 on the Leonardo that I'm using are already occupied and have pins in them from a custom hat that was designed before needing i2c.
Now I want to add i2c without having to make substantial and frankly, unneededd changes to my hardware and software if it is possible to just reassign the i2c SDA and SCL pins.
Where is the call to make this happen? I read that using wire.begin(sda, scl) would do the trick. But that is not true, that function doesn't accept those parameters. It accepts a singe 'address' parameter to use if you want to join the i2c bus as a slave.
I started going through the code in the wire library and I have not come across the answer yet. If somebody knows the answer then please put it here. There are myriad reasons why someone would want to change the pins. That is not a relevant question in response to this question.
The I²C is hardware on the ATmega - it is an actual piece of special purpose logic circuitry connected to particular pins.
You can emulate it is software - there are apparently libraries to do this but it will be cumbersome. (Incidentally, on the ESP, I2C apparently is a software emulation though it may have some special support.)
If you have a poorly designed attachment, well tough! Either modify it or do it the hard way and use the software emulation.
I may be wrong, but you cannot change hardware I2C pins.
An I2C interface requires open drain circuitry with a single common pull-up resistor. Hence you can daily chain.
That circuitry is built into the MCU, and enabled in software. Stick to the I2C pins provided.