ADXL362 Library Issues

Hi

I am using a teensy 3.0 with a TPIC6B595 to run a segmented LED in conjunction with the ADXL362. I have the teesny working properly with the shift register and LED but I can not get the accelerometer to share the data its collecting. I know it is collecting data because I can open the serial monitor and it shows the accelerometer responding to movement but when I try and serial print the variable holding the data it returns a zero. I am a little new to working with libraries, so maybe I am not calling the right variable or I have some syntax wrong. I appreciate and comments. This is a slight modification of the simple read example that comes in the library.

/*
 ADXL362_SimpleRead.ino -  Simple XYZ axis reading example
 for Analog Devices ADXL362 - Micropower 3-axis accelerometer
 go to http://www.analog.com/ADXL362 for datasheet
 
 
 License: CC BY-SA 3.0: Creative Commons Share-alike 3.0. Feel free 
 to use and abuse this code however you'd like. If you find it useful
 please attribute, and SHARE-ALIKE!
 
 Created June 2012
 by Anne Mahaffey - hosted on http://annem.github.com/ADXL362

Connect SCLK, MISO, MOSI, and CSB of ADXL362 to
SCLK, MISO, MOSI, and DP 10 of Arduino 
(check http://arduino.cc/en/Reference/SPI for details)
 
*/ 

#include <SPI.h>
#include <ADXL362.h>


ADXL362 x2; 

int temp;
int XValue, YValue, ZValue, Temperature;


void setup(){
    Serial.begin(9600);
    x2.begin();                   // Setup SPI protocol, issue device soft reset
    x2.beginMeasure();            // Switch ADXL362 to measure mode  
    x2.checkAllControlRegs();     // Burst Read all Control Registers, to check for proper setup
	
    Serial.print("\n\nBegin Loop Function:\n");
}

void loop(){
    
    // read all three axis in burst to ensure all measurements correspond to same sample time
    x2.readXYZTData(XValue, YValue, ZValue, Temperature);  	 
    delay(100);     // Arbitrary delay to make serial monitor easier to observe
Serial.println(XValue);

}

I think at least portions of that library are crap. Read this thread.

https://forum.sparkfun.com/viewtopic.php?f=14&t=37157

My guess is, to use that function, you need to declare XData, YData, ZData and Temperature to be global variables and allow that function to “fill” them. That or rewrite the function to not be void and to return the values it suggests that it does. Heck I’d bet someone has a proper library for the '362.

Yeah I eventually just started writing my own library for the simple reads and setting up the SPI communication. I will post it when I am done. I will check out what else is on the web, I know there are a few libraries that are for other 3 series accelerometers but most of those have dedicated outputs for each channel and dont use the SPI interface.