Skip to content

Result of PWM Functionality Test #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
CedarGroveStudios opened this issue Apr 1, 2018 · 2 comments
Closed

Result of PWM Functionality Test #6

CedarGroveStudios opened this issue Apr 1, 2018 · 2 comments
Assignees

Comments

@CedarGroveStudios
Copy link

CedarGroveStudios commented Apr 1, 2018

  1. rtttl_simpletest.py doesn't work for PWM output.
  2. Print statements in lines 133 and 165 in adafruit_rtttl.py appear to be left over from debugging. If verbose output is required, consider providing an on/off parameter. Suggest updating the documentation accordingly.
  3. In PWM mode on the Gemma M0, adafruit_rtttl doesn't release the output pin to allow playing more than one sequence.

Test code (adapted from the AdaBox007 Learning Guide):

import adafruit_rtttl
import board
import time

a_team = "The A Team:d=8,o=5,b=132:4d#6,a#,2d#6,16p,g#,4a#,4d#.,p,16g,16a#,d#6,a#,f6,2d#6,16p,c#.6,16c6,16a#,g#.,2a#."
bond = "Bond:d=4,o=5,b=320:c,8d,8d,d,2d,c,c,c,c,8d#,8d#,d#,2d#,d,d,d,c,8d,8d,d,2d,c,c,c,c,8d#,8d#,d#,2d#,d,c#,c,c6,1b.,g,f,2g."

while True:
    adafruit_rtttl.play(board.D0, bond)
    adafruit_rtttl.play(board.D0, a_team)

Throws the error:

Traceback (most recent call last):
  File "main.py", line 11, in <module>
  File "adafruit_rtttl.py", line 179, in play
ValueError: Pin PA04 in use
@tannewt tannewt self-assigned this Apr 1, 2018
@tannewt
Copy link
Member

tannewt commented Apr 1, 2018

Good find! I'll fix it later today or tomorrow. We need to call deinit.

@CedarGroveStudios
Copy link
Author

Successfully tested the fix on a Gemma M0. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants