PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
|
Measure acceleration, tilt, and rotation with the Memsic MX2125 Dual-axis Accelerometer. More...
#include "simpletools.h"
Go to the source code of this file.
Macros | |
#define | PI 3.141592653589793 |
Approximation of PI for converting g to angular values like rotation and tilt. | |
Functions | |
int | mx_accel (int axisPin) |
Measure acceleration in terms of g (acceleration due to earth's gravity). A measurement of +/-1250 corresponds to approximately +/- 1 g. More... | |
int | mx_rotate (int xPin, int yPin) |
Measure clockwise rotation assuming accelerometer is held vertical. Zero degree rotation is when the triangle on the MX2125 chip is pointing up. More... | |
int | mx_tilt (int axisPin) |
Measure the level of tilt in terms of +/- 90 degrees. 0 degrees is when the top surface of the accelerometer chip is parallel to the ground. More... | |
Measure acceleration, tilt, and rotation with the Memsic MX2125 Dual-axis Accelerometer.
Definition in file mx2125.h.
int mx_accel | ( | int | axisPin | ) |
Measure acceleration in terms of g (acceleration due to earth's gravity). A measurement of +/-1250 corresponds to approximately +/- 1 g.
axisPin | Number of I/O pin connected to either MX2125's X- or Y- axis pins. |
Definition at line 7 of file mx2125.c.
int mx_rotate | ( | int | xPin, |
int | yPin | ||
) |
Measure clockwise rotation assuming accelerometer is held vertical. Zero degree rotation is when the triangle on the MX2125 chip is pointing up.
xPin | Number of I/O pin connected to MX2125's x-axis pin. |
yPin | Number of I/O pin connected to MX2125's y-axis pin. |
Definition at line 14 of file mx2125.c.
int mx_tilt | ( | int | axisPin | ) |
Measure the level of tilt in terms of +/- 90 degrees. 0 degrees is when the top surface of the accelerometer chip is parallel to the ground.
axisPin | Number of I/O pin connected to either of MX2125's X- or Y- axis pins. |
Definition at line 31 of file mx2125.c.