Used Libraries - AhmedAl-Doori/Jenius GitHub Wiki
Adafruit_LSM303
This library is implemented to get readings from the Accelerometer. read() function gives back two tuples each made of three elements. The first tuple is the most important because it provides orientation data, the useful information for the project. The second tuple is for magnetic field and will not be needed.
import Adafruit_LSM303
mylsm = Adafruit_LSM303.LSM303()
mylsm.read()
Using tuple unpacking, the user can pull each axis as a separate element and display it on the screen or use it for further processing.
accel, mag = mylsm.read()
x, y, z = accel