HI, I am trying to read the X, Y and Z axis of the ADXL362. When all the SPI communication is done in the main I can read all axis fine. When I refactor the code into their own functions e.g. read_x_axis, read_y_axis and read_z_axis it will only let me read one of the axis.
For example if I try and read the x axis on its own it will work. If I try and read the y axis on its own it will work. But if I try and read the x axis and then the y axis, the x axis will return valid results but the y axis returns a constant number, in my case 29545.
I am setting the device into measurment mode correctly.
Am I not doing something else correctly in the setup?
Thanks