I downloaded a program for reading sound from a microphone connected to Analog port 0. Then I wanted to combine that code with a potentiometer that I connected to analog port 7 (on arduino nano). The problem is that the sound program seems to shut down the analog ports. I found that this part of code makes it impossible to read an analog input:
// Init ADC free-run mode; f = ( 16MHz/prescaler ) / 13 cycles/conversion
ADMUX = ADC_CHANNEL; // Channel sel, right-adj, use AREF pin
ADCSRA = _BV(ADEN) | // ADC enable
_BV(ADSC) | // ADC start
_BV(ADATE) | // Auto trigger
_BV(ADIE) | // Interrupt enable
_BV(ADPS2) | _BV(ADPS1) | _BV(ADPS0); // 128:1 / 13 = 9615 Hz
ADCSRB = 0; // Free run mode, no high MUX bit
DIDR0 = 1 << ADC_CHANNEL; // Turn off digital input for ADC pin
TIMSK0 = 0; // Timer0 off
sei(); // Enable interrupts
I wonder if there is any way to reconnect analog port 7 without destroying whatever this code is doing?