IMU
Python Library for ST LSM6DS33 IMU.
Python Library
Turta_IMU library is responsible for reading reading 3D gyro and acceleration data.
Initialization
Add the following statement to the top of your Python code.
Then, create an instance of the IMU class.
Now you're ready to access the library by calling its instance.
Basic Members
Read Accel X
Reads the X-axis acceleration.
Parameters
None
Returns
Int: X-axis acceleration.
Read Accel Y
Reads the Y-axis acceleration.
Parameters
None
Returns
Int: Y-axis acceleration.
Read Accel Z
Reads the Z-axis acceleration.
Parameters
None
Returns
Int: Z-axis acceleration.
Read Accel XYZ
Reads the accelerations of X, Y and Z-axes.
Parameters
None
Returns
Int[]: Acceleration of X, Y and Z-axes respectively.
Read Pitch
Reads the pitch on X-axis.
Parameters
None
Returns
Int: Pitch.
Read Roll
Reads the roll on Y-axis.
Parameters
None
Returns
Int: Roll.
Read Yaw
Reads the yaw on Z-axis.
Parameters
None
Returns
Int: Yaw.
Read Gyro XYZ
Reads the pitch, roll and yaw.
Parameters
None
Returns
Int array: Pitch, roll and yaw values respectively.
Read Gyro Accel XYZ
Reads the accelerations of X, Y, Z-axes and pitch, roll, yaw values.
Parameters
None
Returns
Int[]: X accel, Y accel, Z accel, pitch, roll and yaw values respectively.
Read Internal Temperature
Reads the temperature of the IMU.
Parameters
Bool fahrenheit: True for Fahrenheit output, False for Celcius output. (False is default.)
Returns
Float: Temperature of IMU.
Advanced Members
Test IMU
Sends Who_Am_I command to the IMU, checks if it responses correctly.
Parameters
None
Returns
Bool: True if the device responses with 0x69, False if not.
Finalizer
When exiting from the program, the library turns off the IMU and then releases the SPI bus & interrupt pins.
Last updated