You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Once a pin has been used by analogRead it cannot be returned to digital use with pinMode(xxxx, OUTPUT) because analogRead only frees up the pin when another channel is read. pinMode needs to check if the pin is currently selected for the ADC and if so free it up.
A work around is to free up the pin by selecting a spare with analogRead
I discovered this while porting (from a Uno to Due) a TFT+touchpanel screen which shares digital TFT functions with raw touchpanel resistors.