
Help, GPIO is NOT WORKING!!!!
I installed the GPIO module and python-dev, but the GPIO pins can only recive inputs
. Any ideas? Also, mv multi-meter says that the GPIO pins are producing outputs of 3.7v. My power supply is 5v at 1 amp and I have not overclocked my pi.

Re: Help, GPIO is NOT WORKING!!!!
The gpios are 3.3V.
Have you set the gpios you want to use as outputs to be outputs?
Have you set the gpios you want to use as outputs to be outputs?
Re: Help, GPIO is NOT WORKING!!!!
Yes, the pin is set up for an output
Code: Select all
#!/usr/bin/env python
import RPi.GPIO as gpio, time
gpio.setmode(gpio.BCM)
gpio.cleanup()
gpio.setup(4, gpio.OUT)
while True:
print("Sending Power To LED!!")
gpio.output(4, True)
time.sleep(3)
print("Turning Off LED!!")
gpio.output(4, False)
time.sleep(4)
Re: Help, GPIO is NOT WORKING!!!!
I don't know what cleanup does (I don't use Python).
Is gpio4 the P1-7 pin?
See http://elinux.org/Rpi_Low-level_peripherals
Is gpio4 the P1-7 pin?
See http://elinux.org/Rpi_Low-level_peripherals
Re: Help, GPIO is NOT WORKING!!!!
If you gpio.setmode (gpio.BOARD) you can use the P1 numbers rather than the broadcom numbers. The cleanup function resets every channel used by your program to the system default (input+no pullup/down). It is pointless calling it at the beginning of your script.
- MattHawkinsUK
- Posts: 538
- Joined: Tue Jan 10, 2012 8:48 pm
- Location: UK
- Contact: Website
Re: Help, GPIO is NOT WORKING!!!!
Use the latest Raspian image and you don't have to bother installing RPi.GPIO.
Check the voltage of pin 1 (3.3v) and pin 2 (5v). Use Pin 6 as ground.
Check the voltage of pin 1 (3.3v) and pin 2 (5v). Use Pin 6 as ground.
My Raspberry Pi blog and home of the BerryClip Add-on board : http://www.raspberrypi-spy.co.uk/
Follow me on Google+, Facebook, Pinterest and Twitter (@RPiSpy)
Follow me on Google+, Facebook, Pinterest and Twitter (@RPiSpy)
Re: Help, GPIO is NOT WORKING!!!!
Pin 1 measures 0.01v and pin 2 measures at 0.72v. TP1 and TP2 measure 4.99-5.01v, so I know that my multi-meter is working. Any Ideas? 
EDIT:
I tryed again using TP1 as ground and the pins gave me the correct voltages. There must be something wrong with pin 6.

EDIT:
I tryed again using TP1 as ground and the pins gave me the correct voltages. There must be something wrong with pin 6.

-
- Posts: 557
- Joined: Tue Aug 07, 2012 8:48 pm
- Location: Portugal
Re: Help, GPIO is NOT WORKING!!!!
The cleanup in the beginning is a very good principle. Sometimes we use programs that don't clean the outputs, or we break a program (ctrl+c) before it reaches the clean function, so it's really usefull have that function in the beggining.croston wrote:If you gpio.setmode (gpio.BOARD) you can use the P1 numbers rather than the broadcom numbers. The cleanup function resets every channel used by your program to the system default (input+no pullup/down). It is pointless calling it at the beginning of your script.
Re: Help, GPIO is NOT WORKING!!!!
I tested every gpio pin and found that the 3.3v line gives 1.8v instead and some gpio pins provide 5v and some provide 1.8v. I don't know what to do. Does anyone know what is wrong with my pi? 

Re: Help, GPIO is NOT WORKING!!!!
The cleanup() function will do nothing at the beginning of your code and is completely pointless. The module remembers which channels you have set up using setup() calls in your script and only cleans those up. Therefore calling cleanup() at the start does nothing. It does this so that any other GPIO processes using other channels are not trampled.canibalimao wrote:The cleanup in the beginning is a very good principle. Sometimes we use programs that don't clean the outputs, or we break a program (ctrl+c) before it reaches the clean function, so it's really usefull have that function in the beggining.croston wrote:If you gpio.setmode (gpio.BOARD) you can use the P1 numbers rather than the broadcom numbers. The cleanup function resets every channel used by your program to the system default (input+no pullup/down). It is pointless calling it at the beginning of your script.
Re: Help, GPIO is NOT WORKING!!!!
Have you checked that you're really measuring between ground (0v) and the GPIO pins?kirby2ig wrote:I tested every gpio pin and found that the 3.3v line gives 1.8v instead and some gpio pins provide 5v and some provide 1.8v. I don't know what to do. Does anyone know what is wrong with my pi?
If you accidentally measured between 5v and 3.3v you would see around 1.7v, which is suspiciously close to your 1.8v reading. Also, measuring between 5v and a GPIO pin set to low, would show 5v.
Re: Help, GPIO is NOT WORKING!!!!
There is nothing wrong with your Pi, but the way you are measuring the voltages is incorrect. You jump to conclusions very quickly.kirby2ig wrote:I tested every gpio pin and found that the 3.3v line gives 1.8v instead and some gpio pins provide 5v and some provide 1.8v. I don't know what to do. Does anyone know what is wrong with my pi?
Perhaps one of the mods should retitle the thread.
Texy
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
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555