I am new to the Raspberry Pi and am stumbling a bit as Python is totally new to me.
I would like to be able to control some pins on the GPIO to sound a buzzer and turn on a LED when there is an over temperature event. I have got the Raspberry Pi talking to the ds18b20 thermometers but can not get control of the IO pins.
Here is a simple code snippet that shows the Error ( I am using Geany as my editor )
Code: Select all
import PRi.GPIO as GPIO
def sound_buzzer(n):
GPIO.output(17, GPIO.HIGH if n else GPIO.LOW)
# Set pins for Buzzer
GPIO.warnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.OUT)
I get and Error File "Buzzer.py, line 12, in <module>
GPIO.setup(17, GPIO.OUT)
RuntimeError: No access to /dev/mem. try running as root!
what does this mean and how do I fix it.
Thanks
Leo