Arduino Mega 2560 ground pin short-circuiting?

johnwasser:

rgPaiva:

llamamama:
oh, WOW! that was stupid! and very simple! thank you so much.

Can u tell me the code that you used? The example codes that come with arduino ide, which uses pots, doesn't work with my mega, the one named ReadAnalogVoltage, the output at SerialMonitor is always 5v or 1023.

Sounds like 0V end of your pot isn't connected to Ground. That leaves you with your analog input pin connected through a variable resistor to the +5V pin so it always reads +5V.

The bad way it was connected before would have burnt-out one end of the pot's track I'm afraid...