Accelerometer X Gravity

Hi,

Is it possible to collect the x gravity angle of the iphone when the user presses a button? I would then need to save this angle to use it later in my app.

thanks in advance,

kyle