The device returns an MSB and LSB (in that order) for each axis.
        These are 12 bit values - that is only the upper 4 bits of the LSB are used.

        To make things more confusing, firmata returns each axis as 4 bytes, and reverses the order because
        it looks at the world as lsb, msb order.
        :param callback: Callback function
        :returns: callback data is set with x,y,z raw (integers) followed by x,y,z corrected ( floating point)
        Call available() first to make sure new data is really available.

def read(self, callback=None):
        """
        The device returns an MSB and LSB (in that order) for each axis.
        These are 12 bit values - that is only the upper 4 bits of the LSB are used.

        To make things more confusing, firmata returns each axis as 4 bytes, and reverses the order because
        it looks at the world as lsb, msb order.
        :param callback: Callback function
        :returns: callback data is set with x,y,z raw (integers) followed by x,y,z corrected ( floating point)
        Call available() first to make sure new data is really available.
        """
        register = self.MMA8452Q_Register['OUT_X_MSB']
        self.board.i2c_read_request(self.address, register, 6,
                                    Constants.I2C_READ | Constants.I2C_END_TX_MASK,
                                    self.data_val, Constants.CB_TYPE_DIRECT)


        # get x y z data
        xyz = self.wait_for_read_result()
        self.board.sleep(.001)  # string off address and register bytes
        xyz = xyz[2:]

        xmsb = xyz[0]
        xlsb = xyz[1]
        ymsb = xyz[2]
        ylsb = xyz[3]
        zmsb = xyz[4]
        zlsb = xyz[5]

        xa = int((xmsb << 8) | xlsb) >> 4

        if xmsb > 127:
            xa = 4095 - xa
            xa = ~xa + 1

        ya = int(((ymsb << 8) | ylsb)) >> 4

        if ymsb > 127:
            ya = 4095 - ya
            ya = ~ya + 1

        za = int((zmsb << 8) | zlsb) >> 4

        if zmsb > 127:
            za = 4095 - za
            za = ~za + 1

        cx = xa / 2048 * self.scale
        cy = ya / 2048 * self.scale
        cz = za / 2048 * self.scale

        angle_xz = 180 * math.atan2(xa, za) / math.pi
        angle_xy = 180 * math.atan2(xa, ya) / math.pi
        angle_yz = 180 * math.atan2(ya, za) / math.pi

        if callback:
            callback([xa, ya, za, cx, cy, cz, angle_xz, angle_yz, angle_xy])
        self.board.sleep(.001)

        return [xa, ya, za, cx, cy, cz, angle_xz, angle_yz, angle_xy]