Accel
Python Library for NXP MMA8491Q 3-Axis Accelerometer & Tilt Sensor.
Python Library
Turta_Accel library is responsible for reading 3D acceleration and 3D tilt data from the MMA8491Q sensor.
Initialization
Add the following statement to the top of your Python code.
Then, create an instance of the AccelTiltSensor class.
Now you're ready to access the library by calling its instance.
Basic Members
Read Accel X
Reads the G force of X-axis.
Parameters
None
Returns
Int: G force of X-axis.
Read Accel Y
Reads the G force of Y-axis.
Parameters
None
Returns
Int: G force of Y-axis.
Read Accel Z
Reads the G force of Z-axis.
Parameters
None
Returns
Int: G force of Z-axis.
Read Accel XYZ
Reads the G forces of X, Y and Z-axes.
Parameters
None
Returns
Int[]: G forces of X, Y and Z-axes respectively
Read Tilt X
Reads the X-Axis tilt state.
Parameters
None
Returns
Bool: True if acceleration is > 0.688g or X-axis > 45, false if not.
Read Tilt Y
Reads the Y-Axis tilt state.
Parameters
None
Returns
Bool: True if acceleration is > 0.688g or X-axis > 45, false if not.
Read Tilt Z
Reads the Z-Axis tilt state.
Parameters
None
Returns
Bool: True if acceleration is > 0.688g or X-axis > 45, false if not.
Read Tilt XYZ
Reads the X, Y and Z-Axis tilt states respectively.
Parameters
None
Returns
Bool[]: True if acceleration is > 0.688g or axis > 45, false if not.
Finalizer
When exiting from the program, the library releases the GPIO pins.
Last updated