some basic I2c code and useful classes