accelerometer into class, i2c function into class