hattori&ide
MMA8652 Class Reference
MMA8652 Xtrinsic accelerometer on I2C. More...
#include <MMA8652.h>
Public Member Functions | |
MMA8652 (PinName sda, PinName scl) | |
MMA8652 constructor. | |
~MMA8652 () | |
MMA8652 destructor. | |
void | ReadXYZ (float *a) |
Get XYZ axis acceleration in floating point G's. | |
void | ReadXYZraw (int16_t *d) |
Get XYZ axis acceleration, signed 16 bit values. | |
char | getWhoAmI (void) |
Get the value of the WHO_AM_I register. |
Detailed Description
MMA8652 Xtrinsic accelerometer on I2C.
Definition at line 39 of file MMA8652.h.
Constructor & Destructor Documentation
MMA8652 | ( | PinName | sda, |
PinName | scl | ||
) |
~MMA8652 | ( | ) |
MMA8652 destructor.
Definition at line 28 of file MMA8652.cpp.
Member Function Documentation
char getWhoAmI | ( | void | ) |
Get the value of the WHO_AM_I register.
- Returns:
- DEVICE_ID value == 0x3A
Definition at line 74 of file MMA8652.cpp.
void ReadXYZ | ( | float * | a ) |
Get XYZ axis acceleration in floating point G's.
- Parameters:
-
res array where acceleration data will be stored
Definition at line 81 of file MMA8652.cpp.
void ReadXYZraw | ( | int16_t * | d ) |
Get XYZ axis acceleration, signed 16 bit values.
- Parameters:
-
res array where acceleration data will be stored
Definition at line 98 of file MMA8652.cpp.
Generated on Sun Dec 18 2022 08:16:47 by 1.7.2