I am attempting to run wiringpi
to control the hardware PWM on GPIO 18 on the pi. If I use wiringPiSetupGpio()
as below and I run as root everything works. Using wiringPiSetupSys()
as documentation suggests does not work, even when ran as root.
import wiringpi
wiringpi.wiringPiSetupGpio() #must use with root access
#wiringpi.wiringPiSetupSys() #can use without root, does not work
wiringpi.pinMode(18,2)
wiringpi.pwmWrite(18,500) # dim led
In order to use the non root method I have exported pin 18 as out and verified it with gpio exports
. Can I not use hardware pwm without root or am I missing a fundamental step?