Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Enable digitalRead on output pins, only enable pull-up in digitalWrite if pin is not output #101

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

Merged
agdl merged 5 commits into arduino:master from sandeepmistry:digital-read-write-pullup
Jul 8, 2016

Conversation

Copy link
Contributor

@sandeepmistry sandeepmistry commented Jan 21, 2016

Resolves #56 and #94.

  • pinMode:
    • enable input mode of output pins, to support using digitalRead to read current value (maintains AVR behaviour).
    • disable pull-up on output mode
  • digitalWrite:
    • only enable pull-up if pin is not in output mode and HIGH is passed in, disable pull-up if LOW passed in. (This is similar to [samd] fixing issue #28 #41 , but it did not set OUT which is needed to enable pull-up - as per table 22-1 in the SAMD21 datasheet).
    • simplify some duplicated code, by using local variables.

If this is merged #41 can be closed.

Copy link
Contributor Author

@ArduinoBot build this please

Copy link

digitalWrite: if the pin is in OUTPUT mode, please do not enable/disable/modify the pull-up at all

will it be this way ?

Copy link
Contributor Author

Copy link

is it within the nightly build already ?

Copy link
Contributor Author

@ArduinoBot build this please

Copy link

✅ Build completed.

⬇️ Build URL: http://downloads.arduino.cc/PR/samd/package_samd-b52_index.json

i️ To test this build:

  1. Open the Preferences of the Arduino IDE.
  2. Add the Build URL above in the Additional Boards Manager URLs field, and click OK.
  3. Open the Boards Manager (menu Tools->Board->Board Manager...)
  4. Install Arduino SAMD core - Pull Request Enable digitalRead on output pins, only enable pull-up in digitalWrite if pin is not output #101
  5. Select one of the boards under SAMD Pull Request Enable digitalRead on output pins, only enable pull-up in digitalWrite if pin is not output #101 in Tools->Board menu
  6. Compile/Upload as usual

Copy link
Contributor Author

@dirk67 this change has not been merged into master yet, see @ArduinoBot's comment above for instructions on how to try out these changes.

Copy link

(I am formerly @dirk67)
I tested this and get no errors.
I think this should merged into master now.

mattairtech added a commit to mattairtech/ArduinoCore-samd that referenced this pull request Mar 30, 2016
@agdl agdl merged commit f054f5c into arduino:master Jul 8, 2016
@sandeepmistry sandeepmistry deleted the digital-read-write-pullup branch July 8, 2016 15:00
@cmaglie cmaglie added this to the Release 1.6.19 milestone Jul 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
None yet
Development

Successfully merging this pull request may close these issues.

writing LOW to a digital input pin blocks subsequent digitalRead attempts

AltStyle によって変換されたページ (->オリジナル) /