def read_accelerometer(serial, calibration):
    """
    Reads the raw values from the Arduino, parses them into separate variables
    and uses the calibration data to normalize the data

    Args:
        serial: a reference to the serial connection with the Arduino
        calibration: a reference to the calibration object that holds the
                     values from the accelerometer calibration process
    Returns:
        (x_cal, y_cal, z_cal): a tuple of the normalized data
    """

    components = serial.read_str()
    # parses the string from the Arduino into three separate variables
    x_raw, y_raw, z_raw = tuple(map(float, components.split(',')))

    # normalizes the data using the calibration information
    x_cal = (x_raw - calibration.offset[0]) / (calibration.gain[0])
    y_cal = (y_raw - calibration.offset[1]) / (calibration.gain[1])
    z_cal = (z_raw - calibration.offset[2]) / (calibration.gain[2])

    return (x_cal, y_cal, z_cal)