def normalize_data(raw_data):
    """ Converts raw accelerometer data to normalized values. """
    data = [0, 0, 0]

    # Convert to numbers
    data[0] = (raw_data[0] << 4) + (raw_data[1] >> 4)
    data[1] = (raw_data[2] << 4) + (raw_data[3] >> 4)
    data[2] = (raw_data[4] << 4) + (raw_data[5] >> 4)

    # Fix 2's complement numbers
    for i in range(3):
        if data[i] >> 11 == 1:
            data[i] -= 2**12

    return data