Can I use i2c on custom pins?


How can I use the i2c library on a different pair of pins? The i2c component in CW seems hardwired to SDA on pin 7 and SCL on pin 19.

I would like to use SDA on pin 20 and SCL on pin 19 but it’s not obvious even glancing at the sources.


After looking through the i2c.h/cpp code and hardware specs it seem like this is not possible. Although making a an alternate I2C implementation seems like an interesting project…

As MattiasF says, the I2C interface is a hardware uC peripheral and you can’t select where to put it. The same happens with the UART, the SPI and timer-based components (input-capture, output-compare, pwm).