360 degree rotation on all axis, LIS3DSH
Hi all, I'm working with the LIS3DSH accelerometer which is the accel2 click board on the raspberry pi. I was able to get the angles of x, y, and z-axis based on the binary reading and I was also able to determine the roll and pitch of the accelerometer based on the equation I found in the datasheet. The question I have is, how am I let it suppose to know that it has done a full 360-degree turn? As of now, it knows that when I turn the accelerometer tune 90 degrees, it shows me the angles of x and z plane with respect to the z-axis. As soon as the threshold gets more than 90 degrees, it resets to zero and does the math again. I am not able to implement it based on the figure I found in the datasheet which I have attached below, along with a snippet of my code which calculates the angles based on the readings outputted by the accelerometer. You can have a look at my whole '.c' code as well, which I have attached. How am I to do this?

#lis3dsh