Adarsh Singh
Posts: 21
Joined: Mon Jun 06, 2016 9:18 am

Inputs to GPIO

Sat Jun 25, 2016 2:31 pm

Hey,
I'm very new to raspberry pi and I am not able to understand :?: what is the difference between
GPIO.high and
GPIL.low
Thanks for any help.

bytesoup
Posts: 4
Joined: Mon Jul 30, 2012 12:14 pm

Re: Inputs to GPIO

Sat Jun 25, 2016 2:33 pm

Hi Adarsh,

From this page : https://www.raspberrypi.org/documentation/usage/gpio/
...When the pin is HIGH it outputs 3.3 volts (3v3); when the pin is LOW it is off....

Adarsh Singh
Posts: 21
Joined: Mon Jun 06, 2016 9:18 am

Re: Inputs to GPIO

Sat Jun 25, 2016 2:50 pm

bytesoup wrote:Hi Adarsh,

From this page : https://www.raspberrypi.org/documentation/usage/gpio/
...When the pin is HIGH it outputs 3.3 volts (3v3); when the pin is LOW it is off....
I know that this is for the output, But does this also apply on inputs.
eg
While gpio2.high
print ('button pressed')?

User avatar
joan
Posts: 14935
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Inputs to GPIO

Sat Jun 25, 2016 2:59 pm

A GPIO in mode INPUT will
  • read 1 (high) if 3V3 is connected
  • read 0 (low) if 0V is connected

Adarsh Singh
Posts: 21
Joined: Mon Jun 06, 2016 9:18 am

Re: Inputs to GPIO

Sun Jun 26, 2016 6:17 am

joan wrote:A GPIO in mode INPUT will
  • read 1 (high) if 3V3 is connected
  • read 0 (low) if 0V is connected
ok now i get it

User avatar
Burngate
Posts: 6302
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Inputs to GPIO

Sun Jun 26, 2016 3:53 pm

bytesoup wrote:From this page : https://www.raspberrypi.org/documentation/usage/gpio/
... When the pin is HIGH it outputs 3.3 volts (3v3); when the pin is LOW it is off ...
I'm not sure I agree with the second half of that ...
... When the GPIO pin is LOW it outputs 0v - so if you connect a LED plus resistor from a 3v3 pin to the GPIO, the LED will light
- if it were off, as in a switch is off, no current could flow and the LED wouldn't light.

Possibly nit-picking, but also possibly giving the reader the wrong idea from the start.

gordon77
Posts: 5036
Joined: Sun Aug 05, 2012 3:12 pm

Re: Inputs to GPIO

Sun Jun 26, 2016 4:23 pm

Agreed, LOW means connected to gnd.

Adarsh Singh
Posts: 21
Joined: Mon Jun 06, 2016 9:18 am

Re: Inputs to GPIO

Mon Jun 27, 2016 9:21 am

Thanks for all your help.
I have now understood this :)

Return to “Beginners”