Skip to content

Due: digitalRead of output pin always returns 0, should return pin state for compatibility with '328 version #1597

Closed
@billroy

Description

@billroy

This program prints '1' on a '328 and '0' on the Due; it should print '1' in both cases:

void setup() {
  pinMode(13,OUTPUT);
  digitalWrite(13, 1);
  Serial.begin(57600);
  Serial.print(digitalRead(13));
}
void loop() {}

Apparently the Due version of digitalRead() does not provide the same behavior as the '328 version where output pins are concerned. If true, this is a backwards compatibility behavior issue.

Please consider the large amount of existing code which depends on legacy behavior and the costs to your users of discovering and fixing these problems one-by-one in the field when prioritizing backwards compatibility and, especially, fixing backwards compatibility bugs.

Thanks guys,

-br
http://bitlash.net

Metadata

Metadata

Assignees

Labels

Board: Arduino DueApplies only to the DueComponent: CoreRelated to the code for the standard Arduino API

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions