/* Returns the oversampled conversion results on the specified ADC channel. 
Read more: AVR121: Enhancing ADC resolution by oversampling [ */
uint32_t adcReadOversampled(uint8_t channelNum, uint8_t extraBits)
/* Returns the oversampled conversion results on the specified ADC channel. 
Read more: AVR121: Enhancing ADC resolution by oversampling [ */
uint32_t adcReadOversampled(uint8_t channelNum, uint8_t extraBits)
{
        uint16_t adcValue = adcReadSingle(channelNum);
        adcOversampled += adcValue;
    }
    adcOversampled = adcOversampled >> extraBits;
    return adcOversampled;
}