added some code to read from i2c