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
Rollup optional pull specification into getDigitalValue #156
Labels
Comments
Thanks @cefn. Agree with all that, except the last point. getDigitalValue() is the known name - I think we should stick with it. I'll draft up a pull request (pun intended!) for review. |
finneyj
added a commit
that referenced
this issue
Jun 3, 2016
- Introduced an overload to MicroBitIOPin::getDigitalValue() to permit the setting of a specific pull mode at the time of reading. - Bugfix of MicroBitIOPin::setPull() to persist preferred pull settings - Added configuration options to allow the default PullMode to be set via compile time option through MicroBitConfig.h or YOTTA_CONFIG
finneyj
added a commit
that referenced
this issue
Jun 3, 2016
…ePullOverload microbit: Added getDigitalValue overload for PullMode #156
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a change request following some consensus on medium-term workarounds for the surprising pull-down defaults of digitalWrite (surprising for experienced makers anyway, although that doesn't mean wrong).
This originates in the downstream discussion at... bbcmicrobit/micropython#288 and also relates to the discussion of pull defaults
The request is to provide a signature for getDigitalValue which promotes visibility of software-controllable pull behaviour and makes the existing default pull-setting visible and more accessible, as well as seamlessly allowing getDigitalValue calls to be opinionated about pull, and encouraging the downstream languages to extend their own mappings of the getDigitalValue call to include pull specification.
THE PROPOSAL
Pull should be set by...
An alternative to avoid the potential for getDigitalValue() to be mistakenly substituted for setDigitalValue() which would end up with the same argument signature and a single character difference, is to provide getPulledValue() but this does not have the benefit of encouraging downstream languages to track an existing API they are bound to, and they may remain oblivious to the need to expose this key operation.
The text was updated successfully, but these errors were encountered: