GY-521 sensor, angle output

This my first time working on the" gy-521" 3 axis sensor, is there a way to use it to get just the angle of a wood bar when it’s placed on the wood bar. and that wood bar is connecting the top of 2 hydraulic jack’s, when the wood bar is not horizontal the process of leveling should start, so once the wood bar is leveled “0 degrees” the whole process of leveling that wood bar should stop, so I need input be in angles.
I already made the whole system work by using a simple tilt switch sensor “mercury” the same that is used with cars trunks but it lack accuracy .
Thank you guys in advance


It's not that simple.
The gyro will drift and the accelerometer will go wild with a little motion.
You need filtering and for good results you need to combine both the gyro and the accelerometer.
They are MEMS sensor, very usefull, but far from ideal.