A0 controlling A1 value

I'm just getting back into Arduino after a long break and I'm having a bit of an issue that I've never come across before.

Simple set up of 2 Pots one on A0 and the other on A1.

The pot on A0 is amending the value on both instead of just A0. If I move A1 to A2 it works OK (changing the program to suit).

I've tried this on two Mega's and a Nano and have the same problem.

Tried a 100ms delay between the two reads no change.

Using version 1.8.10 of the IDE, also tried version 1.8.9 that was on the same machine.

The only other thing connected is a 20x2 display running on an I2C controller. Tried the Analogue to serial example and had the same issue.

I plan on building a Midi controller and want to use all 16 Analogue pins for pots so this does cause an issue.

And your test code is what ?

I don't know about the Mega, but the 328P only has one A to D converter which is switched between analogue inputs when required, so a settling time between successive reads, often done by reading twice and discarding the first reading, is often advised

Are your pots greater than 20k in value? If so then cross-talk could be possible - the analog inputs need a 10k
source impedance or less to be accurate.

Show us your circuit?

I’ve tried delays between reading each analogue input to try and eliminate the settling time but this makes no difference.

If it was this then I would expect to see a change if I moved the pot on A1 but only changes if I move the pot on A0 and both A0 and A1 value change the same.

Pots being used are 10K and also tried 5K.

A delay is useless as the ADC switches from channel to channel only upon the start of the read.

So what you should do to get stable readings:

uint16_t val0 = analogRead(A0); // dummy reading to set ADC to this channel & allow time (~110µs) for the voltage to settle.
val0 = analogRead(A0); // Actual reading.
uint16_t val1 = analogRead(A1); // As above.
val1 = analogRead(A1);

No change, even tried two dummy reads to see if that made any difference.

If I move both pots up one ie to A1 and A2 its works fine. If it was the reading issue I would expect to see the same issue.

Beginning to think this is an error in the IDE, to either prove or disprove this I'll put an older version on another PC and give that a go.