The benefit of the real 'g-force' or the raw analogRead() value for the offset is better to read code.
This is your module: http://www.liquidware.com/shop/show/SEN-3AX/3-axis+Accelerometer+Module
That module is 5V tolerant. It looks as if there is a voltage regulator for 3.3V on the module.
So you should connect it to 5V.
According to the cheatsheet, also the range selection pins could be connected to 5V or GND.
Mostly the z-axis is up.
If AREF is not connected (to 3.3V) anymore, the default range of the analog input is 5V again.
So you have range 2g selected.
The way you adapted the example code is okay.
I would like to take it one step further (expect some errors in the code, I didn't test it):
// MMA7260QT Accelerometer
// The range is set with two pins (g-Select1 and g-Select2).
// It can be set to : 1.5, 2.0, 4.0 or 6.0 g
// The output signal is regardless of the voltage.
// It is :
// 800mV/g for range 1.5 g
// 600mV/g for range 2 g
// 300mV/g for range 4 g
// 200mV/g for range 6 g
// For 2 g range, and the accelerometer at 3.3V,
// and an analog input with 5V reference (=DEFAULT),
// the calculation is this:
// voltage = raw * 5V / 1023steps
// g = voltage / 600mV
// However, if the Aref is connected to 3.3V, the
// full range is 0 ... 3.3V for 1024 steps.
// g = analogRead(channel) * 3.3 / 1023.0 / 0.6;
// The y-axis points up, so the y value should be 1g for the earth gravity.
// The values are the values at start. The 1g for the z-axis is taken
// care for later in the program.
center_x = give_me_my_g (ACC_X); // value at 0g (horizontal)
center_y = give_me_my_g (ACC_Y); // value at 0g (horizontal)
center_z = give_me_my_g (ACC_Z); // value at 1g (pointing up)
// The z-axis offset "center_z" is not at zero g, but at 1 g.
// So add 1 to the acc_z.
acc_x = give_me_my_g (ACC_X) - center_x; // remove the center (the offset)
acc_y = give_me_my_g (ACC_Y) - center_y; // remove the center (the offset)
acc_z = give_me_my_g (ACC_Z) - center_z + 1.0; // remove the center (the offset), add 1
double give_me_my_g (int channel)
// analogRead can be used without setting the pinMode.
// 5.0 : The default range of the ADC, (3.3 if Aref connected to 3.3V)
// 1023.0 : the maximum raw value at the maximum voltage
// 0.6 : the number of mV/g. It is 600mv/G for 2g range.
g = (double) analogRead(channel) * 5.0 / 1023.0 / 0.6;
An example of someone with that kind of module: http://antipastohw.blogspot.nl/2010/03/making-of-gravitational-rc-driving-by.html
->edit: I thought that the y-axis was up, but it is the z-axis, this post changed for z-axis.