I'm new to pyboard and almost telecommunications engineer, and I say almost because I chose to build a quadcopter using the pyboard.
I'm using the module mpu9150.py and a MPU 9150 of course. I got to control the motors by using the timers, but I'm stuck now on calculating the pitch and roll. I got to get the angle between 90 and -90 for both pitch and roll from the accelerometer but I wasn't so succesful on getting them from the gyro. Since it gives a rate per axis, I've been trying to integrate this by performing an addition with the previous calculated angle and the current rate times dt (something like actual time - previous time + 1/sample_rate) among other things, and I can't seem to understand what I'm doing wrong, and it seems it happens to lot of people since in my research through hundreds of forums, I found out this is many people's problem. So this is a cry for help since I've been stuck at this point for a long time and I still need to calculate yaw and altitude. The project consists on implementing a code that allows the quadrotor to fly steady and stationary without falling down

I'll leave you a github repository in case you fancy to take a look at my code.
https://github.com/insekto87/Pyboard-Quadcopter
Any help would be really appreciated!! Thank you in advance!!