I am trying to measure the input voltage on my Arduino Mega clone according to Nick Gammon's page (https://www.gammon.com.au/forum/?id=11497). I measured the constant InternalReferenceVoltage = 1050 and ran the getBandgap function as given on his page. However, I end up with weird numbers on the Serial output:
-235.52 V -117.76 V -296.96 V -235.52 V 0.00 V 1.05 V 1.05 V 1.05 V -117.76 V -235.52 V -117.76 V -117.76 V -296.96 V -235.52 V -117.76 V 0.00 V -117.76 V 0.00 V
My laptop would have been dead if it could give out -300 volts
There is nothing connected to the Mega.
Do you have any idea what could be going on?
I previously did the same procedure on a Nano and it reliably calculates its Vin, so I am not sure what I could be doing wrong. Is my Mega damaged?