Now, I found the block was in ADC, i am not sure it is suitable to attach the ADC code here or I should open a new thread. Since it was part of my question, so I just attach them here:
if(knob == 1){
ADMUX |= (1<<MUX0);
ADMUX &= 0b11110001;
} else if(knob == 0){
ADMUX &= 0b11110000;
}
int readingInterH = 0;
int readingInterL = 0;
int readingInter = 0;
ADCSRA |= 1<<ADSC;
readingInterH = ADCH;
readingInterL = ADCL;
readingInter = (ADCH<<8)|ADCL;
readingInter = readingInter>>6;
reading = readingInter / 1023.0;
Is there any issue I lost?