-
Notifications
You must be signed in to change notification settings - Fork 44
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
Setting pull up resistors #24
Comments
Thanks for the quick response. I thought in the top example though that the third parameter sets the pin LOW, not the pins pull up resistor. If that is the case would the following code set the pin to input and set the pull up resistor to high? |
Thanks for the second example but I don't want to use hardware pull-ups. I want to use the Pi's internal pull up resistors. |
Wiring Pi has a separate function (pullUpDnControl (int pin, int pud) )to set the pins internal resistors to either off, up, or ground. This is set independent of the pins direction and whether it is high or low. I am looking for the equivalent of this in ofxGPIO. |
sorry but I thought you were referring to the initial status of the PIN if you talk about the PUD status, the gpio class at the moment is not able to manage it.. ofxGPIO include also BCM2835 you can try starting from: https://github.com/kashimAstro/ofxGPIO/blob/master/src/bcm2835.c#L409-L423 however, I also recommend taking a look at wiringpi good day! |
just for information, ofxGPIO was born with the purpose of managing multiple types of board (not just raspberry), many of which do not provide a pinout with integrated resistors. that's why I decided to manage I/O with sysfs: however this is not always comfortable, as soon as I'm free from work I'll try to implement new boards-specific features. |
OK, I understand. Thanks for the clarification. For now I'll use system() to call wiring pi at runtime. I spotted this in bcm2835.h :
If I get time I'll also look at exposing this functionality on the Pi at least. Thanks very much for all your work on ofxGPIO. |
I can't find out how to set the pull up resistors in ofxGPIO? or is this feature not supported.
The text was updated successfully, but these errors were encountered: