-
Notifications
You must be signed in to change notification settings - Fork 45
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
Gpio io #20
Comments
Hi @fred-dev sorry for delay, but i'm traveling for work. you can set the status (UP / DOWN) of the pin during setup, the last parameter accepts: example: reference: sorry, what is node red? |
Sorry for not explaining, node red is a utility that comes with the
raspberry pi raspbian installation that can also access the gpio pins
https://nodered.org.
I will try setting the low/high option as soon as I get back to my project
next week.
Cheers
…On Sun, 13 May 2018, 1:40 PM Dario Longobardi ***@***.***> wrote:
Hi @fred-dev <https://github.com/fred-dev> sorry for delay, but i'm
traveling for work.
you can set the status (UP / DOWN) of the pin during setup, the last
parameter accepts:
LOW or HIGH.
example:
pin.setup(GPIO17, OUT, LOW);
reference:
https://github.com/kashimAstro/ofxGPIO/blob/master/src/gpio.h#L37
https://github.com/kashimAstro/ofxGPIO/blob/master/src/gpio.h#L42
sorry, what is node red?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#20 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABg9lcdAtDqRZWveh8XRpScNzRDNPStDks5tx_hqgaJpZM4T7EDw>
.
|
After some more serious debugging, I still have this error. Initially using code from your examples I get no response from ofxGpio using an input pin. If I use python or node-red to check the gpio (using an input as I am using a button), it works, once I have done that I can then use code with ofxGpio. This works for some time and then stops. I can get the button working again 100 percent of the time by udsing node red or python to acceess the gpio and then it will work perfectly. ofxGpio stops working 100% of the time if the pi loses power, other . It seems it does not initialise the input pin properly (output pins always work). Also your above comment to use gave me a more often functioning result, you suggest this:
is a bit confusing, in your examples you use the syntax
How should this work? Maybe this is what is giving me strange results.
It is not clear from your code and as far as I can see your examples use a syntax that in my code does not work for a simple input, when my circuit works perfectly with other code. I would really like this project to have a button.... |
Hi @fred-dev, This is very strange, i have a lot of work around on raspberry using I / O I can tell you with certainty that ofxgpio unlike other library if you are having problems with I/O through ofxgpio you can try to execute your own execs to initialize the pins and manage I/O example on pin 17:
this weekend I will a check on ofxgpio to verify this your report. I keep you updated! Thanks! |
Hello @kashimAstro ,
works great, because, pin4 (BCM) has by default PULL UP resistor. Well now I need a second button and there is no more defaulted pin like this one, so I need to be able to set pin17 to a pull-up resistor. Is this provided with the addon ?? EDIT: I found out that pin3 is working for my second button, but question remains, how to change the PUD ? There is function in bcm2835.h file of the addon: Thanks :) |
I have a strange issue, I am running my app with elevated (Sudo) permissions. I don't get any response from a simple push button until I run node red to test the setup. Then my OF app will run perfectly until a reboot.
The only obvious difference I see is node red has a checkbox for setting pull up and pull down states for input pins. Is this function available in ofxgpio or is there something deeper at play.
I am using the latest OF and stretch install.
The text was updated successfully, but these errors were encountered: