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.
Fork of _HW3_DHT_TCP 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 8 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 55 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 156 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 232 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 224 of file MMA7455.cpp.
Generated on Fri Jul 15 2022 05:54:01 by
1.7.2
