def getXYZ(self):
    """ Read and return the current acceleration as a list: [x,y,z]. """
    data = self.readReg(self.REG_DATAX0, 6)
    samples = [0]*3
    for i in range(0, 3):
      # Combine high and low byte:
      samples[i] = (data[i+i+1]<<8) | data[i+i]
      # Convert from 2's complement:
      if samples[i] >= 32768: samples[i] -= 65536
      # Convert to G:
      samples[i] *= self.G_PER_BIT[self.accel_range]
    return samples
dataset/ETHPy150Open graycatlabs/PyBBIO/bbio/libraries/ADXL345/ADXL345.py/ADXL345.getXYZ/original