Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
billroy opened this issue Sep 29, 2013 · 2 comments
Assignees
Labels
Board: Arduino Due Applies only to the Due Component: Core Related to the code for the standard Arduino API

Comments

@billroy
Copy link

billroy commented Sep 29, 2013

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

@labraloutre
Copy link

Hi,
I've encountered the same problem Yesterday on an Arduino micro 5V, with latest IDE
I guess the problem isn't only for the Due board.

Thanks

@facchinm
Copy link
Member

facchinm commented Jan 7, 2016

Solved by #3524

@facchinm facchinm closed this as completed Jan 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Board: Arduino Due Applies only to the Due Component: Core Related to the code for the standard Arduino API
Projects
None yet
Development

No branches or pull requests

5 participants