combined code for LCD, PB, and I2C