How do I get my GPIO to work without getting syntax errors in my program, it says it doesn't recognise GPIO.
How do I get my GPIO to work without getting syntax errors in my program, it says it doesn't recognise GPIO.
We need a bit more info than that.
What program? Can you post the source code?
Do you have the exact working of the errors?
Mike
My program reads, "import RPi.GPIO as GPIO
The error I get is that "GPIO unknown"
Every time I use "GPIO" it gives me a syntax error.
Regards
Geoff
OK Geoff. It appears you are using python
what if you type
sudo python <name of your program>
?
Mike
Hi, it will not hurt to try the following few steps:
Do a latest update:
1. sudo apt-get update
Then install the Python Development toolkit that RPi.GPIO requires:
2. sudo apt-get install python-dev
Then to install Rpi.GPIO itself type:
3. sudo apt-get install python-rpi.gpio
You will probably be prompted to confirm by entering 'Y'.
Then try your program again.....
Regards.
Yunus Vollenhoven
South Africa
What I get after . " sudo apt-get install python-dev"and " sudo apt-get install python-rpi gpio
is "unable to locate package python.rpiand "unable to locate package.gpio"
Thank you for the ideas, any thing else?
Regards,Geoff
Is your Raspberry Pi connected to the internet? Are you running Raspbian?
Pardon my pudding....
I omit the fact that you have to have an active connection to the internet to do these updates.....
Yunus.
Looks like code from https://sourceforge.net/projects/raspberry-gpio-python/ It showed be downloaded and installed with deb command in Linux. But the description says:
Note that the current release does not support SPI, I2C, 1-wire or serial functionality on the RPi yet. This is planned for the near future - watch this space!
So beware!
C