Fixed the ADC threshold issue