1

I need the raspberry Pi to respond to some buttons. I'm writing this in Pure C, using the wiringPi library. As such, I thought it prudent to use the gpio utlitily to make sure my pins were sane before coding.

Alas, they are not sane. I'll admit, I'm using a simple, resistor-free way of testing this - a few wires with open copper on the ends and crimped housing on the other: enter image description here Easy Enough....

But alas, I CANNOT get any the GPIO pins to respond regardless of what I do. I can make at least one of the pins go from high to low (several of them were high by default when using gpio readall, but under no circumstances can I make a low pin (0) go high(1)!

I've had this working in the past - it shows identical behavior on both of my Raspberry Pis.

I am trying the GPIO pins (pick a pin, any pin) and I have them connected to a ground pin.

But gpio read [X] only ever returns 0! Despite this I can gpio mode [X] out and gpio write logic states - this behaves exactly as expected, if my multimeter is to be believed.

Could someone be so kind as to tell me what is wrong with my approach?

Running Raspian, by the way.

1

It's hard to tell from your photo, but it looks like you've connected the +5V to the GPIO pin. The GPIO is only +3.3V tolerant. Any pin you're trying to pull high should be connected to Pin 1 only.

It might be worth investigating the use of a pull-up/down resistor. I've outlined how to do this in software in this previous answer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.