Need help with gyroscope/accelerometer - orientation

I have successfully installed a GY-521 (MPU-6050) and can read the raw values, but am lost understanding the output. Imagine for illustration that the unit is mounted in a six sided box so that initially the sides can be thought of as top, bottom, left, right, front, back...I am trying to return the current orientation simply as "which side is up". Can anyone help?

First figure out which parts of the sensor output correspond to the X, Y and Z axes of the accelerometer.

Then, when the sensor is lying still and flat on a table, it will read a large acceleration value (corresponding to about "1 g" in the down direction) along one of the axes and only small acceleration values on the other two. Flip it over or reorient to check the other directions and axes.

CPARKTX:
I have successfully installed a GY-521 (MPU-6050) and can read the raw values ... I am trying to return the current orientation simply as "which side is up".

Suggest you print out the raw values and just see how they change as the orientation changes. It should be obvious from the output which sensor axis is aligned with vertical in each orientation.

Get a copy of the 1) Product Specification 'PS-MPU-6000A.pdf' and 2) Register Mapping and Description 'RM-MPU-6000A.pdf, and a 3) good stiff drink, then settle down for a lot of reading....
everything you need to know.

And/or a copy of Krodal's MPU-6050Test pde and disect it.

MPU6050_Test.pde (32.3 KB)

RM-MPU-6000A.pdf (827 KB)

PS-MPU-6000A.pdf (1.87 MB)