This code shows how to interface an ADXL 345 accelerometer using AVR over I2C