Schnell
Posts: 19
Joined: Sat Jun 21, 2014 4:02 am

How get status of GPIO pins(high or low)?

Fri Sep 18, 2015 12:01 am

I want to find the status of a certain GPIO pin and determine whether it's high or low. I'd then like to output it in someway to a webpage that'd basically be a little circle that changes from green to red when the status is either high or low. Just for some background I'm using the raspberry pi to drive a relay that turns on a light. I have it all working and turning the light on and off, I just want some sort of status light so I can tell if the light is on or off. It's definitely needed in case I accidently turn it on when I'm away from the light and can't tell if it's on or off.
Sorry if it isn't clear, if it's not then I can clearify in future posts or add anymore needed info.

Thanks!



texy
Forum Moderator
Forum Moderator
Posts: 5156
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: How get status of GPIO pins(high or low)?

Fri Sep 18, 2015 10:50 am

Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

User avatar
RaTTuS
Posts: 10365
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: How get status of GPIO pins(high or low)?

Fri Sep 18, 2015 11:33 am

sudo apt-get install raspi-gpio
sudo raspi-gpio get
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

Return to “Beginners”