I am using LM35 to measure ambient temperature. It is connected to A15 on my Arduino mega and it is working well when used alone.
To display the temperature I am using a LCD shield which 5 buttons connected to A0. When I press one button it changes the voltage on A0, so reading the value on A0 I know what button is pressed.
With the actual temperature the right value returned by analogRead(A15) is something between 36 and 38, but when I use analogRead(A0) on my code and the pin A0 is connected to +5V (no button pressed) the read in A15 grows to something between 70 and 75...
But when I press any button (and the input on A0 is changed to something less than +5V) I get the right read on A15.
I've tried to use an delay of 1 second between those 2 reads, but it did not worked....
What could be wrong? Is it a bug, or am I doing something wrong?