Want to use I2c port as I/O port without an expander

Hey guys,
I want to know if there is a way to use some of my I2c ports as I/O ports, but without an expander. Is there some kind of code that I can implement to do so?
Thanks,
Kaushik

I2C is a bus. There must be a receiver to interpret the data sent. If you don’t want to use an expander like PCF8585, what do you want to use? Another Arduino?

Considering Arduino UNO -- the A4 and A5 lines are configured as I2C Bus where they have taken the functions of SDA and SCL lines respectively. Do you want to know if these lines could still be used as digital IO or analog Input lines? The answer is NO.

By default, the A4 and A5 lines are the digital IO lines corresponding to the pc4 and pc5 lines of Port-C Register. These two lines have alternate functions, and these are: analog inputs (Ch-4 and Ch-5) for the internal ADC; SDA and SCL lines for the I2C Bus. Once the lines are initialized to take over either of their alternate functions, they lose their capabilities as digital IO lines. In order to regain the functionalities of the digital IO lines, we have to deactivate the ADEN-bit of ADCSR Register (disable ADC) and TWEN-bit of TWCR Register (disable TWI/I2C Bus).

I’m confused by the statement “some of my I2C ports”. I take that to mean on of addressable I2C locations on the I2C bus as there is only one I2C port on the Arduino.

"some of my I2c ports", do you mean "some of my I2c pins"? And what board are we talking about you have "some"?

If you have a Uno, you only have two pins for hardware I2C. You can use them as normal IO pins if you don't want to use I2C.

I think we need to wait for the OP to explain what (s)he really means. :roll_eyes:

Bit of a waste of time surmising.