Skip to content

Moved from pulseio.PWMOut to pwmio.PWMOut #23

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

Merged
merged 1 commit into from
Feb 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions adafruit_rtttl.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import sys
import time
import pulseio
import pwmio

AUDIOIO_AVAILABLE = False
try:
Expand Down Expand Up @@ -112,7 +112,7 @@ def _get_wave(tune, octave):
# pylint: disable-msg=too-many-arguments
def _play_to_pin(tune, base_tone, min_freq, duration, octave, tempo):
"""Using the prepared input send the notes to the pin"""
pwm = isinstance(base_tone, pulseio.PWMOut)
pwm = isinstance(base_tone, pwmio.PWMOut)
for note in tune.split(","):
piano_note, note_duration = _parse_note(note, duration, octave)
if piano_note in PIANO:
Expand Down Expand Up @@ -179,7 +179,7 @@ def play(pin, rtttl, octave=None, duration=None, tempo=None):

# Fall back to PWM
if not base_tone:
base_tone = pulseio.PWMOut(pin, duty_cycle=0, variable_frequency=True)
base_tone = pwmio.PWMOut(pin, duty_cycle=0, variable_frequency=True)

_play_to_pin(tune, base_tone, min_freq, duration, octave, tempo)

Expand Down