As per the conversation at
My Accelerometer code would now look like:
//connecting the ADXL362 breakout board https://www.sparkfun.com/products/11446
//**************************** Start Important Photon Information *********************************
// Connect the ADXL362 breakout SPI connections:
// VIN: 3V3
// GND: GND
// SCL: A3 (SCK)
// SDA: A5 (MOSI)
// SDO: A4 (MISO)
// CS: A2 (SS) If only one SPI board this can be grounded
// INT1: no connection
// INT1: no connection
// Must include the ADXL362 library from Particle.io libraries.
// Search for ADXL362 and include it in this Application
// It will auto setup all dependcies and
// include a statment like the following at the top of the page. Only allow one of these statements.
// This #include statement was automatically added by the Particle IDE.
#include <adxl362.h>
//**************************** End Important Photon Information *********************************
ADXL362 xl;
int16_t temp;
int16_t XValue, YValue, ZValue, Temperature;
float XValueF, YValueF, ZValueF;
void setup(){
xl.begin(SS); // Setup SPI protocol, issue device soft reset
xl.beginMeasure(); // Switch ADXL362 to measure mode
}
void loop(){
// read all three axis in burst to ensure all measurements correspond to same sample time
xl.readXYZTData(XValue, YValue, ZValue, Temperature);
// Convert to m/^s
XValueF = XValue/100.0;
YValueF = YValue/100.0;
ZValueF = ZValue/100.0;
// convert to degreees Celcius
Temperature = Temperature / 14.5;
Particle.publish("Temp="+String(Temperature)+" °C", String("x=" + String(XValueF, 2)+", y=" + String(YValueF, 2)+", z=" + String(ZValueF, 2)), 60, PRIVATE);
delay(1000);
}