import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setup(18,GPIO.OUT)
print("LED on")
GPIO.output(18,GPIO.HIGH)
time.sleep(1)
print ("LED off")
GPIO.output(18,GPIO.LOW)
Im̀ trying to proof my rpi pi 5 and i have installed ubuntu 23, and i installed all the necesary lib to use the gpio but the console on the env return
File "/home/jdam/prueba/prueba.py", line 4, in <module>
GPIO.setup(18,GPIO.OUT)
RuntimeError: No access to /dev/mem. Try running as root!
So i don`t understand what is happening,if you could help me that would be wonderful
pd: i am installing tensorflow but i can`t do it because this error:
Building h5py requires pkg-config unless the HDF5 path is explicitly specified using the
environment variable HDF5_DIR. For more information and details, see https://docs.h5py.org/en/stable/build.html#custom-installation
error: pkg-config probably not installed: FileNotFoundError(2, 'No such file or directory')
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for h5py
Failed to build h5py
ERROR: Could not build wheels for h5py, which is required to install pyproject.toml-based projects