-
Notifications
You must be signed in to change notification settings - Fork 220
Closed
Description
I have been trying to get PWM working on pins P2_01 and P2_03 on the PocketBeagle but have been unsuccessful. I am using Debian 9.5 and have installed the Adafruit-BBIO library. I do have digital outputs working but no PWM. I wrote a short program to test PWM as seen here:
import Adafruit_BBIO.PWM as PWM
pin_l = "P2_1" # GPIO050 (A PWM1) - Left Motors Pin
pin_r = "P2_3" # GPIO023 (B PWM2) - Right Motors Pin
DC_l = 100 # Duty Cycle in % from (0-100) - Left Motors Pin
DC_r = 100 # Duty Cycle in % from (0-100) - Right Motors Pin
PWM.start(pin_l, 0, 1000) # Start PWM on Left Motors Pin
PWM.start(pin_r, 0, 1000) # Start PWM on Right Motors Pin
while 1:
PWM.set_duty_cycle(pin_l, DC_l) # Set PWM on Left Motors Pin
PWM.set_duty_cycle(pin_r, DC_r) # Set PWM on Right Motors Pin
PWM.stop(pin_l)
PWM.stop(pin_r)
PWM.cleanup()
When I run this program I get the below error:
Traceback (most recent call last):
File "/var/lib/cloud9/pwm.py", line 9, in <module>
PWM.start(pin_l, 0, 1000) # Start PWM on Left Motors Pin
RuntimeError: Problem with the cape manager
As you can see, the program fails when starting PWM on the first pin and I have been unable to solve this issue. Also, this code does work perfectly fine on the BeagleBone Black after changing the code to use its PWM pins.
Metadata
Metadata
Assignees
Labels
No labels