User manual

www.sainsmart.com
Copyright © 2013 SainSmart All Rights Reserved
Packing list: 1 x Module 2 x Pins
Specification
sDimensions (cm): 2.1 x 1.6 x 0.3
Weight (kg): 0.005
If you need more information about MPU6050, visit:
http://www.sainsmart.com/sainsmart-mpu-6050-3-axis-gyroscope-module.html
Example code
This code is without the algorithm, so the result is just raw data!
// Arduino Wire library is required if I2Cdev I2CDEV_ARDUINO_WIRE implementation
// is used in I2Cdev.h
#include "Wire.h"
// I2Cdev and MPU6050 must be installed as libraries, or else the .cpp/.h files
// for both classes must be in the include path of your project
#include "I2Cdev.h"
#include "MPU6050.h"
// class default I2C address is 0x68
// specific I2C addresses may be passed as a parameter here
// AD0 low = 0x68 (default for InvenSense evaluation board)
// AD0 high = 0x69
MPU6050 accelgyro;
int16_t ax, ay, az;
int16_t gx, gy, gz;
#define LED_PIN 13
bool blinkState = false;
void setup() {
// join I2C bus (I2Cdev library doesn't do this automatically)
Wire.begin();
// initialize serial communication
// (38400 chosen because it works as well at 8MHz as it does at 16MHz, but
// it's really up to you depending on your project)
Serial.begin(38400);
// initialize device
Serial.println("Initializing I2C devices...");