Converts the output from the ADC into the desired type.

def convert_adc(value, output_type, max_volts):
    """
    Converts the output from the ADC into the desired type.
    """
    return {
        const.ADC_RAW: lambda x: x,
        const.ADC_PERCENTAGE: adc_to_percentage,
        const.ADC_VOLTS: adc_to_volts,
        const.ADC_MILLIVOLTS: adc_to_millivolts
    }[output_type](value, max_volts)