I can’t see any danger in using AN_INPUT, but have you tried the intended behaviour I described above, where you set INPUT_PULLUP once and thereafter let analogRead()
do the switching between modes?
BTW, with such minimal signals, I’d rather go for a measuring amplifier.
Update
I have now tested the intended behaviour and it seems that there is something “broken”.
I filed an issue on GitHub
With this issue present, I’d think pinMode(A2, AN_INPUT)
is the only way to go, if you want to stick with that kind of hardware setup.
And I already proposed the documentation of AN_INPUT
back in February
[solved] Analog pin configuration outside of setup()