I2C example

My point is that you buy an I2C chip that does what you want. That is the slave. Your controller is the master, it tells the slaves what to do. You want an LED controller? Buy an I2C one. You want a relay control? Buy an I2C module.