Leapo / Rock64-R64.GPIO

Python GPIO library for the Rock64 SBC (RPi.GPIO clone)
GNU Lesser General Public License v3.0
60 stars 25 forks source link

pwm error #2

Open saiparvathi opened 6 years ago

saiparvathi commented 6 years ago

Hi I am running ubuntu 18 on rock64 and I am trying to run my servo motor through pwm gpio pins .

I am facing an pwm error when I tried to run example program provided in your repo

python R64-GPIO-test.py

error

Testing R64.GPIO Module...

Module Variables: Name Value


GPIO.ROCK ROCK GPIO.BOARD BOARD GPIO.BCM BCM GPIO.OUT out GPIO.IN in GPIO.HIGH 1 GPIO.LOW 0 GPIO.PUD_UP 0 GPIO.PUD_DOWN 1 GPIO.VERSION 0.6.3 GPIO.RPI_INFO {'P1_REVISION': 3, 'RAM': '1024M', 'REVISION': 'a22082', 'TYPE': 'Pi 3 Model B', 'PROCESSOR': 'BCM2837', 'MANUFACTURER': 'Embest'} Error: Unable to export GPIO Error: Unable to set GPIO direction Error: Unable to export GPIO Error: Unable to set GPIO direction

Testing GPIO Input/Output: You must setup() the GPIO channel (BOARD 16) first Output State : None You must setup() the GPIO channel (BOARD 16) as an output first You must setup() the GPIO channel (BOARD 18) first Input State : None

Waiting 3 seconds for interrupt... You must setup() the GPIO channel (BOARD 18) as an input first Timeout! You must setup() the GPIO channel (BOARD 16) as an output first

Testing PWM Output - DutyCycle - High Precision: 60Hz at 50% duty cycle for 1 second Traceback (most recent call last): File "R64-GPIO-test.py", line 67, in p.start(50) File "/home/rock64/sdl/sen/Rock64-R64.GPIO/R64/_GPIO.py", line 351, in start self.pwm_calc() File "/home/rock64/sdl/sen/Rock64-R64.GPIO/R64/_GPIO.py", line 368, in pwm_calc self.sleep_low = (1.0 / self.freq) * ((100 - self.dutycycle) / 100.0) AttributeError: PWM instance has no attribute 'freq'

sdvcrx commented 6 years ago

Try this -> https://github.com/Matei-Ciobotaru/Rock64-R64.GPIO