I am trying to read values from ADC0 on the ATMEGA328p (the datesheet of atmega328p). The values expected are between 0-5v. This is due to ADC0 being connected to a potentiometer connected to the 5v output of a Xplained mini. I am getting either 0v or 5v usually. With no variation when the potentiometer is changed. I have looked at multiple ADC examples and tutorials online but cant find the error in my code.
And as mentioned above I know the error is not in my UART code but somewhere in the above ADC code. Cheers in advance for any help.