adafruit / adafruit/adafruit-beaglebone-io-python

BeagleBone Blue PWM

Open
#313 14 comments 0 reactions 1 assignee Claimed by @pdp7 View on GitHub
enhancement help wanted
Dominant language
C
Stars
479
Forks
214
PR merge metrics
No merged PRs in 30d

Description

- Platform/operating system: **BeagleBone Blue, bone-debian-9.5-iot-armhf-2018-10-07**

- Python version: **Python 3.5.3 and Python 2.7.13**

- Error message you are receiving, including any Python exception traces:
```
debian@beaglebone:~$ sudo python3 fade.py
Traceback (most recent call last):
File "fade.py", line 6, in
PWM.start(pwm, 0)
ValueError: Invalid PWM key or name.
```

- List the steps to reproduce the problem below:

Code:**`fade.py`**
```
import Adafruit_BBIO.PWM as PWM

pwm = "P9_23"

#PWM.start(channel, duty, freq=2000, polarity=0)
PWM.start(pwm, 0)

#optionally, you can set the frequency as well as the polarity from their defaults:
#PWM.start(pwm, 50, 1000, 1)

PWM.set_frequency(pwm, 10)

PWM.set_duty_cycle(pwm, 0)

for x in range(10000):

for duty in range(0,100,1):

PWM.set_duty_cycle(pwm, duty)
time.sleep(0.05)

for duty in range(0,100,-1):

PWM.set_duty_cycle(pwm, duty)
time.sleep(0.05)
```
Run:
```
sudo python3 fade.py
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.