Read MPU6050 using ATMEGA 2560

Hashan123:
why we are shifting bits to the left twice?

You're not. It's reading in a byte for X acceleration, storing that in a 16 bit number, then shifting that byte 8 bits to the left. Then another byte for X acceleration is read in and that's stuffed into the now empty lower 8 bits yielding a 16 number for X acceleration. This process is then repeated for the other accelerations and gyro outputs. It's done this way because the device reads and stores accels and rotational rates as 16 bit values, but must transfer them at only 8 bits a time.

Thank You Very Much…!!! :slight_smile: