Skip to content

Due bug: Cannot use pin as digital after analogRead #2198

Closed
@trickedj

Description

@trickedj

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions