Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: ConfigFile SDFileSystem mbed
Fork of LAURUS_program by
Diff: MPU6050/MPU6050.h
- Revision:
- 0:bc6f14fc60c7
- Child:
- 1:6cd6d2760856
diff -r 000000000000 -r bc6f14fc60c7 MPU6050/MPU6050.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/MPU6050/MPU6050.h Fri May 15 17:24:32 2015 +0000
@@ -0,0 +1,47 @@
+#pragma once
+
+const static int mpu_addr = 0xd0;
+
+typedef union {
+ uint8_t reg[14];
+ struct {
+ uint8_t acc_x_L;
+ uint8_t acc_x_H;
+ uint8_t acc_y_L;
+ uint8_t acc_y_H;
+ uint8_t acc_z_L;
+ uint8_t acc_z_H;
+
+ uint8_t T_L;
+ uint8_t T_H;
+
+ uint8_t gyro_x_L;
+ uint8_t gyro_x_H;
+ uint8_t gyro_y_L;
+ uint8_t gyro_y_H;
+ uint8_t gyro_z_L;
+ uint8_t gyro_z_H;
+ } byte;
+
+ struct {
+ int16_t acc[3];
+
+ int16_t T;
+
+ int16_t gyro[3];
+ } value;
+} MPU_DATA;
+
+class MPU6050 {
+public:
+ MPU6050(I2C* i2c);
+ ~MPU6050();
+
+ int init();
+ int read();
+
+ MPU_DATA data;
+
+private:
+ I2C* i2c;
+};
\ No newline at end of file
