Update version of EALib.
Dependencies: FATFileSystem
Fork of EALib by
MMA7455 Class Reference
Freescale Accelerometer MMA7455. More...
#include <MMA7455.h>
Public Types | |
enum | Range |
Acceleration range. More... | |
Public Member Functions | |
MMA7455 (PinName sda, PinName scl) | |
Create an interface to the MMA7455 accelerometer. | |
bool | calibrate () |
Calibrate for 0g, that is, calculate offset to achieve 0g values when accelerometer is placed on flat surface. | |
bool | getCalibrationOffsets (int32_t &xOff, int32_t &yOff, int32_t &zOff) |
Get calculated offset values. | |
bool | setCalibrationOffsets (int32_t xOff, int32_t yOff, int32_t zOff) |
Set calibration offset values. |
Detailed Description
Freescale Accelerometer MMA7455.
Definition at line 24 of file MMA7455.h.
Member Enumeration Documentation
Constructor & Destructor Documentation
MMA7455 | ( | PinName | sda, |
PinName | scl | ||
) |
Create an interface to the MMA7455 accelerometer.
- Parameters:
-
sda I2C data line pin scl I2C clock line pin
Definition at line 71 of file MMA7455.cpp.
Member Function Documentation
bool calibrate | ( | ) |
Calibrate for 0g, that is, calculate offset to achieve 0g values when accelerometer is placed on flat surface.
Please make sure the accelerometer is placed on a flat surface before calling this function.
- Returns:
- true if request was successful; otherwise false
Definition at line 172 of file MMA7455.cpp.
bool getCalibrationOffsets | ( | int32_t & | xOff, |
int32_t & | yOff, | ||
int32_t & | zOff | ||
) |
Get calculated offset values.
Offsets will be calculated by the calibrate() method.
Use these values and put them in persistent storage to avoid having to calibrate the accelerometer after a reset/power cycle.
- Parameters:
-
xOff x offset is written to this argument yOff y offset is written to this argument zOff z offset is written to this argument
- Returns:
- true if request was successful; otherwise false
Definition at line 248 of file MMA7455.cpp.
bool setCalibrationOffsets | ( | int32_t | xOff, |
int32_t | yOff, | ||
int32_t | zOff | ||
) |
Set calibration offset values.
These values should normally at one point in time have been retrieved by calling the getCalibrationOffsets method.
- Parameters:
-
xOff x offset yOff y offset zOff z offset
- Returns:
- true if request was successful; otherwise false
Definition at line 240 of file MMA7455.cpp.
Generated on Thu Jul 14 2022 09:42:14 by 1.7.2