GPIO2/3 gets input while no high is send to it
Hello dear community,
when i set the GPIO2/3 to input ("gpioctl dirin 2") and read the signal ("gpioctl get 2") it gets allways a LOW. Now the strange thing. When i plug in a cable and no connection on the other side (just in air) it gets sometimes a HIGH. Not helpfull to read a switch.
I tried to reset the Omega2 but same problem
I have no more ideas how to fix this issue.
Hope you can help me. Im a bit frustrated
@Marc-André-Fleischmann An empty GPIO Input is floating - ie. its HIGH / LOW state is not determined.
If you want to read a switch you should use
- a pull up resistor to 3.3V and pull down the input to GND with that switch
- a pull down resistor to GND and pull up the input to 3.3V with that switch
- or for example this SPDT switch
See also Reading a Switch
Thanks for help.
It seems the digital pins are very sensitive. And because there are no analog pins included in the Omega2 there is only the option to get an arduino dock 2 to realize my cable management.
I whant to use only 2 connections from switch to the Omega (not enought cable).
Might it be possible?
@Marc-André-Fleischmann Sorry, I don't understand your problem / your question.
My question is if i connect a switch only with 3,3V and an input GPIO, could i always read the correct input? That option is necessary to keep my cable management.
Maybe its to be realized by using analog inputs with the arduino dock.