Raspberry pi GPIO don't work
.
Last edited by mibb on Thu Apr 12, 2018 1:45 pm, edited 1 time in total.
Re: Raspberry pi GPIO don't work
Hi and welcome to the forum.
To check the version of RPi.GPIO use this quick check python script:
It should return version 0.5.11 :
If not run the following :
That should get your system up to date. Then try your RPi.GPIO out again,
Texy
To check the version of RPi.GPIO use this quick check python script:
Code: Select all
import RPi.GPIO as GPIO
print GPIO.VERSION
Code: Select all
pi@raspberrypi ~ $ sudo python test2.py
0.5.11
pi@raspberrypi ~ $
Code: Select all
sudo apt-get update
sudo apt-get dist-upgrade
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
Re: Raspberry pi GPIO don't work
.
Last edited by mibb on Thu Apr 12, 2018 1:45 pm, edited 2 times in total.
Re: Raspberry pi GPIO don't work
Please show us the wiring connections, and the program.bmou1999 wrote:Thank you Texy.
I have the right version but the LED don't blink again.
Any ideas?
bmou1999
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
Re: Raspberry pi GPIO don't work
.
Last edited by mibb on Thu Apr 12, 2018 1:44 pm, edited 1 time in total.
Re: Raspberry pi GPIO don't work
In the wiringPi example you are using gpio 18 (pin 12).
In the RPi.GPIO example you are using pin 18 (gpio 24).
In the RPi.GPIO example you are using pin 18 (gpio 24).
Re: Raspberry pi GPIO don't work
.
Last edited by mibb on Thu Apr 12, 2018 1:44 pm, edited 2 times in total.
- DougieLawson
- Posts: 42177
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
Re: Raspberry pi GPIO don't work
There's more than one numbering system for the pins.bmou1999 wrote:Thank you joan.
Which number for the LED have i to use in my python script for GPIO 18?
bmou1999
You can either use "board" numbering which is simply the physical pin number, so pin 18 is right hand side nine rows down. Or your can use "Broadcom" or "BCM" numbering which uses the names of the pins on the System on a Chip (SoC) they don't have a straight mapping to the physical pins.
Take a look at http://pi.gadgetoid.com/pinout which, hopefully, clears up your confusion.
Try running the
gpio readall
command which gives a picture of the pins and their current settings.
Languages using left-hand whitespace for syntax are ridiculous
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
Re: Raspberry pi GPIO don't work
.
Last edited by mibb on Thu Apr 12, 2018 1:44 pm, edited 2 times in total.
- DougieLawson
- Posts: 42177
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
Re: Raspberry pi GPIO don't work
RPi.GPIO.setmode(RPi.GPIO.BOARD)
RPi.GPIO.setmode(RPi.GPIO.BCM)
Allows you to pick alternative numbering schemes.Choose ONE scheme and always use that in your code.
RPi.GPIO.setmode(RPi.GPIO.BCM)
Allows you to pick alternative numbering schemes.
Code: Select all
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
GPIO.setmode(GPIO.BCM)
Languages using left-hand whitespace for syntax are ridiculous
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
Re: Raspberry pi GPIO don't work
.
Last edited by mibb on Thu Apr 12, 2018 1:44 pm, edited 1 time in total.
Re: Raspberry pi GPIO don't work
.
Last edited by mibb on Thu Apr 12, 2018 1:44 pm, edited 2 times in total.
Re: Raspberry pi GPIO don't work
.
Last edited by mibb on Thu Apr 12, 2018 1:44 pm, edited 1 time in total.
Re: Raspberry pi GPIO don't work
.
Last edited by mibb on Thu Apr 12, 2018 1:44 pm, edited 2 times in total.
Re: Raspberry pi GPIO don't work
..it goes on for 1 second, then goes off. You need to add 1 second delay after the off, otherwise it will be on all the time, well to the naked eye anyway.
Texy
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