Issues with Pins 2 and 3 when Using I2C

I am using an Arduino Leonardo to control an automated focusing system, with stepper motors etc.
There are several limit switches involved, and two of these are connected to digital I/O pins 2 and 3, through 1k series resistors and protection diodes.
All input lines are configured as INPUT_PULLUP.

All works perfectly well, untill I added an LCD display (with I2C interface board)
I have 2.2k pullup resistors on the SDA and SCL lines. (these are dedicated pins on the Leonardo).

As soon as I do this, pins 2 and 3 do not toggle when grounded through the 1k resistors.
Simply adding the pullup resistors is enough to stop pins 2 and 3 from toggling. If I remove them, then the same problem arises as soon as I use the LCD.begin command.

All the other digital inputs work normally.
Is there anything peculiar about pins 2 and 3 that could cause this behavior?

Welcome to the forum

Your topic was MOVED to its current forum category which is more appropriate than the original as it has nothing to do with Installation and Troubleshooting of the IDE

Please post your full sketch and a schematic of your project. A picture of a hand drawn circuit is good enough

According to this pin out of the Leonardo, pins 2 and 3 are the I2C pins, SDA and SCL.

They are also broken out as SDA and SCL, but they go to the same places (pins 2 & 3).

Pin out from here >> Arduino Leonardo Pinout Guide (ATmega32u4) - NerdyTechy

Well that explains everything!
Thanks

Please mark the thread as solved so that other members that wish to help will not waste their time opening the thread only to find that you no longer need help.

OK will do,
This was my first time using the forum, so I wasn't sure of the protocol.
Thanks again for your help.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.