Suggestion re analogReference()


In my project, I am calling analogReference(INTERNAL2v56) at the start of a function and analogReference(DEFAULT) at the end. This is the only place, and for just 1 reading, that I need this internal reference. All other ADC readings need 5v.

The resultant readings I am getting are crazy, and inconsistant.

Searching around, I found threads that state:-

a) analogReference() only specifies the reference to be used, and is only attached at the next analogRead(), so a 'blank' analogRead() should be called before you take a reading.

b) The reference voltage specified can take several mS to stabilise, so a delay, or millis, of about 10mS should follow.

c) At this point an x = analogRead() can be executed.

Reading Section 26, of the data sheet, would seem to confirm this.

This fix brought my results a lot closer to what I expect

No mention of this appears anywhere in the information on Arduino Reference.

If this can be confirmed by the Gurus, would it be possible to have info about this inclused in the analogReference page?