Cleaned up ADC code and corrected ADC clock source and acquisition time settings.