MPU 6050 (GY521) + Arduino mega2560

Hello every body

hope to be good
first let me apologize for my poor English

i am new to Arduino and i want to set up MPU 6050 with it

i have downloaded a sample code that will be attached to this topic

but whenever i want to compile it, i encounter with the error that is as below

I2Cwrite was not declared on this scope
Arduino: 1.5.6-r2 (Windows 8), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

MPU6050.ino:21:17: error: I2C.h: No such file or directory
MPU6050.ino: In function 'void setup()':
MPU6050:51: error: 'i2cWrite' was not declared in this scope
MPU6050:52: error: 'i2cWrite' was not declared in this scope
MPU6050:54: error: 'i2cRead' was not declared in this scope
MPU6050:63: error: 'i2cRead' was not declared in this scope
MPU6050.ino: In function 'void loop()':
MPU6050:91: error: 'i2cRead' was not declared in this scope

This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.

i want to know what will you suggest me to overcome this problem

thanks for help

mfzavareh@hotmail.com

IMU6DOF.zip (21.2 KB)

error: I2C.h: No such file or directory

There's your problem.

Where did you get that code from ? You can copy the url in the text.

hello again

i am not sure about where i got the code

how ever i have attached it to my post

i will send the address as i get it

thanks

i try to fix it with your help

If you are going to use the i2cdevlib, at least use the newest and original i2cdevlib.
http://www.i2cdevlib.com/
You have to install two libraries: the MPU-6050 library and the i2cdevlib itself.

You can not connect the MPU-6050 to the Arduino Mega 2560. You need a level shifter for the I2C bus.
If you have connected it correct, you can try the i2c_scanner to see if the I2C bus is working.
http://playground.arduino.cc/Main/I2cScanner