Skip to content

analogRead doesn't allow to read all channels #181

@arnakke

Description

@arnakke

Currently wiring_analog.c only allows to read channel 0 through 7. However, the internal temperature sensor is located on channel 8.

Fix. Change line 69 in wiring_analog.c
From:
ADMUX = (analog_reference << 6) | (pin & 0x07);
To:
ADMUX = (analog_reference << 6) | (pin & 0x0F);

This will allow to read all channels without any drawbacks as far a I can tell.

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