code: def convert_adc(value, output_type, max_volts):
      
      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)
docs: Converts the output from the ADC into the desired type.