Analog Read Serial is not working with Mega 2560

I am attempting to read a linear pot that I have. I have been using the Analog Read Serial example from the web page https://www.arduino.cc/en/Tutorial/AnalogReadSerial

However, the data coming to the serial monitor only shows a range of values from 1023 with 5 volts being fed to the A0 pin down to 915 with 0 volts.

I have confirmed the voltages being fed to the A0 pin with a meter.

I have used the example code exactly as it is on the web page.

As a test, I switched the wiper from the Pot to A1, and modified the code to use A1. But, the results are exactly the same.

Any ideas?

Thank You, -Joe

What resistance do you measure across your pot (across the two end terminals)?

What resistance do you measure between each end terminal and the wiper when the wiper is roughly in the middle?

Does the A0 pin still read 915 when you jumper it directly to Ground?

Your suggestion that I connect the analog to ground was the suggestion I needed. It confirmed that the board and software worked, and also forced me to re-connect things.

Here is the full story, if it may help others who go down this path...

Yesterday, I had I confirmed that the resistance of the pot is what it should be across the end terminals. Also, confirmed that the wiper is behaving as expected for this linear-taper pot. So, mid-way is mid-way in terms of resistance.

When the circuit was live, the voltage at the wiper is also as expected.

However, I had not tried connecting the analog pin to ground. But, my test probes and alligator clips were in the way, so I decided to just disconnect them and try to start with everything as simple as possible. I had actually already done a re-work of the connections yesterday probably three times.

The test showed that it did, indeed show the expected 0 value when the analog pin was connected to ground. So, my Mega was working! I re-connected everything to test, and was surprised that the values now only ranged from 0 to 454! Re-checking the connections, I saw that one of jumpers that I thought was to 5v, was actually on the 3.3v pin.

It can be difficult to see which pin corresponds to which label on my Mega. In the attempt yesterday, I am taking a wild guess that I may have connected the pot to 5v and 3.3v. So, "low" would have been 3.3v.

Thank you for taking the time to try to remotely trouble-shoot my situation.

-Joe