farouk
Posts: 3
Joined: Mon Dec 22, 2014 2:25 am

GPIO Problem

Mon Dec 22, 2014 2:44 am

hi, I'm new in raspberry pi programming ,I try to test the code bellow but it cannot worked someone help me please :oops:
Attachments
x.PNG
result
x.PNG (18.73 KiB) Viewed 1369 times
d.PNG
code
d.PNG (24.78 KiB) Viewed 1369 times

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

Re: GPIO Problem

Mon Dec 22, 2014 7:35 am

Hi,
I think it tells you what the problem is. What are you running it on - your PC?
(Hint : it would appear that you are NOT running the example code on a raspberry pi).
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

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: GPIO Problem

Mon Dec 22, 2014 11:41 am

Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

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

Re: GPIO Problem

Mon Dec 22, 2014 12:00 pm

Assuming you are running on a Pi.

Perhaps you are running a custom kernel?

If so could you post the contents of /proc/cpuinfo?

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

Re: GPIO Problem

Mon Dec 22, 2014 12:05 pm

If you want the Python to run on a PC but use the Pi's gpios (and the Pi is networked) you can use the pigpio Python module.

User avatar
DougieLawson
Posts: 39121
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: GPIO Problem

Mon Dec 22, 2014 12:13 pm

It could be a RPi A+ or B+ with a version of RPi.GPIO that's too old to recognise the /proc/cpuinfo revision number.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

farouk
Posts: 3
Joined: Mon Dec 22, 2014 2:25 am

Re: GPIO Problem

Mon Dec 22, 2014 6:12 pm

yes texty I running my raspberry pi B+ on my pc using ethernet câble "RG45"
Last edited by farouk on Mon Dec 22, 2014 6:37 pm, edited 1 time in total.

DirkS
Posts: 10363
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: GPIO Problem

Mon Dec 22, 2014 6:15 pm

farouk wrote:yes I running my raspberry pi B+ on my pc
How? Are you using an emulator?

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

Re: GPIO Problem

Mon Dec 22, 2014 6:19 pm

farouk wrote:yes I running my raspberry pi B+ on my pc
If you have a Raspberry Pi on the same network as your PC you can use pigpio on your PC.

Alternatively you could use putty (or ssh on Linux) to log into your Pi from your PC and then use other Python modules actually on the Pi.

farouk
Posts: 3
Joined: Mon Dec 22, 2014 2:25 am

Re: GPIO Problem

Mon Dec 22, 2014 6:44 pm

yes I use a windows emulator for raspberry it's called "QEMU"

DirkS
Posts: 10363
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: GPIO Problem

Mon Dec 22, 2014 6:58 pm

farouk wrote:yes I use a windows emulator for raspberry it's called "QEMU"
qemu is not the same as a RasPi.
You could try Dougie's suggestion: http://www.raspberrypi.org/forums/viewt ... 05#p658162

User avatar
kusti8
Posts: 3439
Joined: Sat Dec 21, 2013 5:29 pm
Location: USA

Re: GPIO Problem

Mon Dec 22, 2014 11:27 pm

farouk wrote:yes I use a windows emulator for raspberry it's called "QEMU"
Why don't you connect your raspberry pi to your pc and then just ssh or vnc into it. If you don't have a pi, you can't use the gpios
There are 10 types of people: those who understand binary and those who don't.

Return to “General discussion”