Help needed with the MPU-6050.

I recently purchased the MPU-6050 from ebay. I’ve always been skeptical about buying from ebay, and luckily they have a 14 day return policy, if it is damaged. So, i need to check its working asap. As i’m new to interfacing with i2c, i thought for the time being i’d use this code from http://arduino.cc/playground/Main/MPU-6050 to check if my component works. But it shows compile error “F was not declared in scope” ( Serial.println(F(“InvenSense MPU-6050”)); ) Could someone help me out? Thanks in advance.

The 'F()' only places the string in code memory (in flash), instead of RAM.
So if it is not working, just remove it like this: Serial.println("InvenSense MPU-6050");

If there is a problem with my sketch, I want to fix it!
Have you changed something in the sketch ?
Which Arduino board do you use ?
Are you using the newest Arduino. Version 1.0.1 ?

Thanks for your reply. :slight_smile:

I haven't changed any of the code, copy pasted the entire code. I'm using arduino 0022. Board- arduino duemilanove.

The sketch compiles for a Duemilanove (both ATmega328 and ATmega168), but you have to update to the new Arduino 1.0.1 !

If you are new to I2C, try the i2c_scanner first : Arduino Playground - HomePage

As you told, i changed the f from the serialprint, but now a new error comes in this code.

  n = Wire.write(start);

error-

class Twowire has no member named write

I tried the i2c scanner and it was working fine. :slight_smile:

The sketch compiles for a Duemilanove (both ATmega328 and ATmega168), but you have to update to the new Arduino 1.0.1 !

Oh okay. :slight_smile: