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.
Dependents: BLE_Nano_MPU6050Service
Diff: MPU6050.h
- Revision:
- 5:5739a7a6d0e9
- Parent:
- 3:a6e53ab2c8c0
- Child:
- 6:73c2cfe26ed8
diff -r 5a52b575fbc6 -r 5739a7a6d0e9 MPU6050.h
--- a/MPU6050.h Wed Jul 22 13:20:30 2015 +0000
+++ b/MPU6050.h Wed Jul 22 16:02:20 2015 +0000
@@ -14,13 +14,6 @@
#include "mbed.h"
#include "helpers.h"
-typedef struct
-{
- int16_t ax, ay, az;
- int16_t temp;
- int16_t ox, oy, oz;
-} MPU6050SensorReading;
-
class MPU6050
{
public:
@@ -34,7 +27,14 @@
// look at https://developer.mbed.org/users/okano/notebook/i2c-access-examples/
ADDRESS_0 = BYTE(01101000) << 1,
ADRESSS_1 = BYTE(01101001) << 1
- };
+ };
+
+ typedef struct
+ {
+ int16_t ax, ay, az;
+ int16_t temp;
+ int16_t ox, oy, oz;
+ } SensorReading;
enum Register
{
@@ -575,7 +575,7 @@
int16_t* ox, int16_t* oy, int16_t* oz,
int16_t* temp, float timeout_secs = defaultTimeout_secs);
- bool getMotionAndTemperature(MPU6050SensorReading *sensorReading, float timeout_secs = defaultTimeout_secs);
+ bool getMotionAndTemperature(SensorReading *sensorReading, float timeout_secs = defaultTimeout_secs);
/**
* REG_MOT_DETECT_STATUS register
@@ -727,9 +727,9 @@
uint8_t ox_h, ox_l;
uint8_t oy_h, oy_l;
uint8_t oz_h, oz_l;
- } reg;
+ } reg;
- MPU6050SensorReading value;
+ SensorReading value;
} converter;
};
