ADXL362 (How to express the results in term of g(gravity)? Thanks

Hi guys, i have connected to an accelerometer (ADXL362) to an arduino leonardo. My connection is followed this reference: SPI - Arduino Reference.

I have successfully got the X,Y and Z data with the following code:

include <ADXL362.h>
#include <SPI.h>
//Objects and Defines
ADXL362 xl;
#define teamID 1

//Variables
int XOffset, YOffset, ZOffset;
long packetCount=0;

void setup(){
xl.begin(); // Setup SPI protocol, issue device soft reset
xl.beginMeasure(); // Switch ADXL362 to measure mode
delay(5); //delay to allow readings to settle before offset definition
XOffset=xl.readXData();
YOffset=xl.readYData();
ZOffset=xl.readZData();
Serial.begin(9600); //Opens serial port at 9600 bauds
Serial1.begin(9600);
while(!Serial){ // waits for the serial port to open before proceeding
}
}

void loop(){
String dataString = "PSTART";
dataString += ",";
dataString += String(teamID);
dataString += ",";
dataString += String(packetCount);
dataString += ",";
dataString += xl.readXData()-XOffset;
dataString += ",";
dataString += xl.readYData()-YOffset;
dataString += ",";
dataString += xl.readZData()-ZOffset;
dataString += ",PEND";
Serial.println(dataString);
Serial1.println(dataString);
packetCount++;
delay(300);
}

However, the X, Y and Z values are in random values, not in term of g. Therefore, can anyone tell me what code i need to convert the values into g (gravity)?

Thanks a lotttttt.

These are the data i got :

XDATA = -32 YDATA = 792 ZDATA = 448
XDATA = -289 YDATA = 272 ZDATA = 688
XDATA = -799 YDATA = 524 ZDATA = 688
XDATA = -285 YDATA = 272 ZDATA = 1196
XDATA = -32 YDATA = 272 ZDATA = 1204
XDATA = 224 YDATA = 524 ZDATA = 1188
XDATA = -285 YDATA = 280 ZDATA = 1204
XDATA = -285 YDATA = 780 ZDATA = 448
XDATA = -32 YDATA = 512 ZDATA = 688
XDATA = -32 YDATA = 272 ZDATA = 700
XDATA = 224 YDATA = 272 ZDATA = 688

If you want to use devices like the ADXL362 intelligently, you need to download and go through the data sheet. The conversion factor is clearly described therein.

In addition, you need to determine the axial offsets and gain values, unique to every individual unit, in order to properly calibrate it. My favorite procedure is clearly described here: Sailboat Instruments: Improved magnetometer calibration (Part 1) (it works for accelerometers as long as the device is held still while each measurement is taken).