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

Support for Pull up / Pull down resistors #6

Closed
user2684 opened this issue Mar 28, 2017 · 3 comments
Closed

Support for Pull up / Pull down resistors #6

user2684 opened this issue Mar 28, 2017 · 3 comments

Comments

@user2684
Copy link

It would be great (if not too complex) to add support for the RPi.GPIO pull_up_down argument of setup() since it is very common to have pull up/down set when reading an input.
I've tried the trick to output e.g. HIGH before reading but I correctly got an error saying the pin is supposed to be an input not an output.
Alternatively, I'd recommend adding the pull_up_down option anyway and just print out a warning saying it is not implemented so to ensure compatibility with existing code. A similar approach can be used for bouncetime and other optional parameters in this way the code will be fully compatible even if the functionality is not implemented.

Thanks

@rm-hull
Copy link
Owner

rm-hull commented Mar 28, 2017

Yes, pull-up and pull-down arguments are on the radar, but at present I'm not sure if it is fully supported by the GPIOs on the Orange Pi Zero. But I like your idea of accepting them regardless and displaying a warning.

Bouncetime should be easier to support, but in the meantime I'll also add the params and emit some warnings.

@rm-hull
Copy link
Owner

rm-hull commented May 27, 2017

Version 0.2.4 adds compatibility (but no functionality other than an emitted warning) for pull-up/down resistors and bouncetime.

@user2684
Copy link
Author

Good job, this will for sure help me in making the code cleaner without too many if based on the platform :-) (https://sourceforge.net/p/my-house/tickets/216/)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants