Re: GPIO re-read output pin

Jul 27, 2013 3 Replies


A little question:


> I put a GPIO at 1 or 0 logic.
> Is possible re-read the actual status of this output?
> Python or shell.
>

You could connect your output pin to an input pin ...



Yes.

The output register is read when you read a pin set to output mode.

The easiest way from the shell (IMO) is to use the gpio command in wiringPi...

e.g.

gordon @ dragonpi: gpio mode 0 out gordon @ dragonpi: gpio write 0 1 gordon @ dragonpi: gpio read 0 1 gordon @ dragonpi: gpio write 0 0 gordon @ dragonpi: gpio read 0 0

See:

formatting link

For more with the disclaimer that I write & maintain it...

Gordon

Gordon Henderson in data 21:14, sabato 27 luglio 2013, nel gruppo comp.sys.raspberry-pi ha scritto:

Thank. Good!

+---------------------------------------------------------------------------+ | Negli ultimi 3 mesi, 25 tamponamenti per leggere questo cartello. | | Guarda avanti, idiota! | +-----#2---------------------Campagna contro le pubblicita` idiote.---------+

This is a generic answer, not Pi-specific: It depends on the design of the port, on how it was configured, and on the external circuitry connected to it. In most systems you can read back from an output pin, but what you read may be a copy what you wrote, even if the actual state is different, based on the factors before.

Roberto Waltman [ Please reply to the group, return address is invalid ]

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required