Use SDA/SLC as Seperate digital Pins from 2/3, Leonardo

Is there a way on the Arduino Leonardo to use the SDA and SLC as digital pins separate from pin 2 and 3.

I bought 3 Arduino Leonardos on the basis they had 20 digital in or outputs but 2 and 3 are linked to SLC and SDA. How can I fix this?

Why do want this change?

How can I fix this?

As far as I can tell from the schematic, you can't fix it. They are physically the same pins. You can add pins with I2C expanders or shift registers. And the analog inputs (I believe on a Leonardo) are also digital pins.

Microcontrollers generally, not just the ones used by Arduino, have multiple different functions allocated to each pin. That means if you use one function on a pin you can't use one of the other functions. This allows for more different functions than there are pins. The alternative would be a lot more pins or very limited capabilities.

reubenclarke_xml:
Is there a way on the Arduino Leonardo to use the SDA and SLC as digital pins separate from pin 2 and 3.

I bought 3 Arduino Leonardos on the basis they had 20 digital in or outputs but 2 and 3 are linked to SLC and SDA. How can I fix this?

Do you mean that you really were hoping for 22 pins - i.e. the 20 numbered pins plus SDA and SLC? If so, then that is not possible.

However if you don't need to use SDA and SLC then you can use the 20 numbered pins.

Note that on a Leonardo pins 0 and 1 are for Serial1 and play no part in communication over the USB cable. This is different from an Uno.

...R