I’m not sure if this is the right place to post this, but it’s kinda related to the IDE
I’ve noticed that analogRead doesn’t require that pinMode( x, INPUT) be called prior to use.
Looking at the core code for analogRead it appears that the IDE may be effectively calling pinMode to setup the analog input each time analogRead is called.
This would slow down analogRead
Or an I miss-reading the core source code.
i.e are the “analog” pins always set for Analog input. I know its possible to call digitalRead and also to set them as output using pinMode(A0,OUTPUT) and digitalWrite(A0,HIGH) is also supposed to work.
so either A0 etc is set to Analog mode by default, and setting pinMode(A0,OUTPUT) followed by analogRead would result in it not reading, or analogRead is setting pinMode
I guess i need to test this last hypothesis ??