connecting 5v output to analog input to "test cables"

Hi,

OP's CODE

Where did this code come from??

This seems to assume a MEGA, is that true??