そのなのとおり

Fork of MPU6050 by Simon Garfieldsg

Files at this revision

API Documentation at this revision

Comitter:
naoki_westwell
Date:
Sun Nov 20 05:04:27 2016 +0000
Parent:
0:662207e34fba
Commit message:
Vertex???

Changed in this revision

I2Cdev.cpp Show annotated file Show diff for this revision Revisions of this file
MPU6050.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/I2Cdev.cpp	Fri Jan 11 00:54:28 2013 +0000
+++ b/I2Cdev.cpp	Sun Nov 20 05:04:27 2016 +0000
@@ -137,6 +137,7 @@
     for(int i =0; i < length; i++) {
         data[i] = redData[i];
     }
+    free(redData);
     return length;
 }
 
--- a/MPU6050.cpp	Fri Jan 11 00:54:28 2013 +0000
+++ b/MPU6050.cpp	Sun Nov 20 05:04:27 2016 +0000
@@ -42,7 +42,7 @@
 
 #include "MPU6050.h"
 
-#define useDebugSerial
+//#define useDebugSerial
 
 //instead of using pgmspace.h
 typedef const unsigned char prog_uchar;
@@ -52,6 +52,7 @@
 /** Default constructor, uses default I2C address.
  * @see MPU6050_DEFAULT_ADDRESS
  */
+
 MPU6050::MPU6050() : debugSerial(USBTX, USBRX)
 {
     devAddr = MPU6050_DEFAULT_ADDRESS;
@@ -63,11 +64,12 @@
  * @see MPU6050_ADDRESS_AD0_LOW
  * @see MPU6050_ADDRESS_AD0_HIGH
  */
+ /*
 MPU6050::MPU6050(uint8_t address) : debugSerial(USBTX, USBRX)
 {
     devAddr = address;
 }
-
+*/
 /** Power on and prepare for general usage.
  * This will activate the device and take it out of sleep mode (which must be done
  * after start-up). This function also sets both the accelerometer and the gyroscope
@@ -83,8 +85,8 @@
 #endif
 
     setClockSource(MPU6050_CLOCK_PLL_XGYRO);
-    setFullScaleGyroRange(MPU6050_GYRO_FS_250);
-    setFullScaleAccelRange(MPU6050_ACCEL_FS_2);
+    setFullScaleGyroRange(MPU6050_GYRO_FS_500); //+/-250,500,1000,2000
+    setFullScaleAccelRange(MPU6050_ACCEL_FS_16); //+/-2,4,8,16
     setSleepEnabled(false); // thanks to Jack Elston for pointing this one out!
 
 #ifdef useDebugSerial