From an Arduino Mega I am outputting 0,1,2,3,4 volts using writePWMVoltage function (at D13), then I connected D13 to A0 for readVoltage. In theory, I am supposed to get 0,1,2,3,4V from A0, but I am only getting values 0 or 5 from A0. I already checked D13 is outputting correct values by measuring with DMM.
Am I wiring something wrong? Why is this happening? Any help is appreciated :)