Hello evryone, I have a problem in my mega card where the values on output from the ADC are not stable, there are two solutions offered on google.
1/ the first to add an external 0v..5v reference in AREF, and I got the result in the first picture:
int a=0;
void setup()
{
Serial.begin(115200);
analogReference(EXTERNAL);
pinMode(A0,INPUT);
analogRead(A0);
}
void loop()
{
a=analogRead(A0);
delayMicroseconds(210);
Serial.println(a);
Serial.print(" ");
}
2/the second solution and add a short delay after the Read function, although this function includes a sufficient delay to convert the analog signal,and I got the result in the second picture:
int a=0;
void setup()
{
Serial.begin(115200);
pinMode(A0,INPUT);
analogRead(A0);
}
void loop()
{
a=analogRead(A0);
delayMicroseconds(210);
Serial.println(a);
Serial.print(" ");
}
so is there any other proposal or is there a possibility that the ADC circuit in the controller is damaged?

