Simple Quadcopter Help with memsic 2125

My group and i are trying to make a simple quadcopter that stabilizes it self.
All it has to do it show that it can hover. The sensor we're using is the memsic 2125 accelerometer, we don't care about drift x y translation, all we care about is being leveled at all times.
So basically when its hovering we want the memsic 2125 to always send the arduino a 50% duty cycle.
How do we program the arduino so it will keep the quad-copter leveled
Again this is just a really basic concept for stability using only a accelerometer.
We have been trying to use a simple p controller to stabilize it but it keeps oscillating. I looked at the aeroquad on google but the code was way over my head. I just need a controller that i can understand the concept of and how to implement it.
Any help will be appreciated
thanks

I'd recommend you read starlino's IMU guide:

To summarize, your accelerometer will detect pitch and roll, but not yaw. I suppose yaw isn't that important to you if your only specification is that it's to hover (i.e. it's ok for it to be spinning as it's doing it). But using only an accelerometer, you'll encounter noise, or jitter, and your readings won't be as accurate as they might need to be. That's why folk use a gyroscope, which is more accurate than an accelerometer. The reason a gyroscope is not used on it's own, is because of 'gyro drift', where the gyroscope becomes inaccurate over time due to varying reference voltages.

So, if you want an accurate measurement in both pitch and roll, use an accelerometer and 2 DOF gyro. Have a read here aswell: