From ad642110571cdb8387060640bb9042a3438536f1 Mon Sep 17 00:00:00 2001 From: Stanley Huang Date: Wed, 25 Jan 2017 23:09:40 +1100 Subject: Remove unneeded libraries --- libraries/MPU6050/MPU6050.cpp | 195 ------------------------------------------ 1 file changed, 195 deletions(-) delete mode 100644 libraries/MPU6050/MPU6050.cpp (limited to 'libraries/MPU6050/MPU6050.cpp') diff --git a/libraries/MPU6050/MPU6050.cpp b/libraries/MPU6050/MPU6050.cpp deleted file mode 100644 index 86901d9..0000000 --- a/libraries/MPU6050/MPU6050.cpp +++ /dev/null @@ -1,195 +0,0 @@ -// MPU-6050 Accelerometer + Gyro -// ----------------------------- -// -// By arduino.cc user "Krodal". -// June 2012 -// Open Source / Public Domain -// -// Using Arduino 1.0.1 -// It will not work with an older version, -// since Wire.endTransmission() uses a parameter -// to hold or release the I2C bus. -// -// Documentation: -// - The InvenSense documents: -// - "MPU-6000 and MPU-6050 Product Specification", -// PS-MPU-6000A.pdf -// - "MPU-6000 and MPU-6050 Register Map and Descriptions", -// RM-MPU-6000A.pdf or RS-MPU-6000A.pdf -// - "MPU-6000/MPU-6050 9-Axis Evaluation Board User Guide" -// AN-MPU-6000EVB.pdf -// -// The accuracy is 16-bits. -// -// Temperature sensor from -40 to +85 degrees Celsius -// 340 per degrees, -512 at 35 degrees. -// -// At power-up, all registers are zero, except these two: -// Register 0x6B (PWR_MGMT_2) = 0x40 (I read zero). -// Register 0x75 (WHO_AM_I) = 0x68. -// - -#include -#include "MPU6050.h" - -// -------------------------------------------------------- -// MPU6050_read -// -// This is a common function to read multiple bytes -// from an I2C device. -// -// It uses the boolean parameter for Wire.endTransMission() -// to be able to hold or release the I2C-bus. -// This is implemented in Arduino 1.0.1. -// -// Only this function is used to read. -// There is no function for a single byte. -// -int MPU6050_read(int start, uint8_t *buffer, int size) -{ - int i, n; - - Wire.beginTransmission(MPU6050_I2C_ADDRESS); - n = Wire.write(start); - if (n != 1) - return (-10); - - n = Wire.endTransmission(false); // hold the I2C-bus - if (n != 0) - return (n); - - // Third parameter is true: relase I2C-bus after data is read. - Wire.requestFrom(MPU6050_I2C_ADDRESS, size, true); - i = 0; - while(Wire.available() && ireg.x_accel_h, accel_t_gyro->reg.x_accel_l); - SWAP (accel_t_gyro->reg.y_accel_h, accel_t_gyro->reg.y_accel_l); - SWAP (accel_t_gyro->reg.z_accel_h, accel_t_gyro->reg.z_accel_l); - SWAP (accel_t_gyro->reg.t_h, accel_t_gyro->reg.t_l); - SWAP (accel_t_gyro->reg.x_gyro_h, accel_t_gyro->reg.x_gyro_l); - SWAP (accel_t_gyro->reg.y_gyro_h, accel_t_gyro->reg.y_gyro_l); - SWAP (accel_t_gyro->reg.z_gyro_h, accel_t_gyro->reg.z_gyro_l); -} -- cgit v1.2.3