hwio icon indicating copy to clipboard operation
hwio copied to clipboard

about to set pin <Number> to output

Open mtavano opened this issue 9 years ago • 1 comments

I'm trying to set high and set low the gpio number 16 (corresponding to pin number 36) where I've a relay connected. mi code looks no more different than the code you've exposed on Readme.

when I execute the binary on my raspberry pi2 I've got the following output

about to set pin 36 to output

and nothing else, either the switch sound when a relay gets an order

I'm executing the binary as sudo. There is something I'm forgetting or doing wrong?

mtavano avatar Mar 01 '17 20:03 mtavano

Hmmm, is the relay connected directly to the GPIO? The maximum current for a GPIO pin is about 16mA, and non-solid-state relays typically require a bit higher than that. It may not have enough power to switch the relay state. One thing to try is putting an LED with current limiting resistor on the pin, to see if it's switching.

mrmorphic avatar Jun 16 '17 12:06 mrmorphic