adafruit / Adafruit_CircuitPython_RTTTL

Play RTTTL tunes in CircuitPython
MIT License
4 stars 12 forks source link

Support PWM output. #5

Closed tannewt closed 6 years ago

tannewt commented 6 years ago

Also make the RTTTL parsing more resilient to whitespace and capitalized notes.

deshipu commented 6 years ago

I think it would be much cleaner to have a separate function (or class) for playing a specified tone for a specified duration (like Arduino's tone() for example), and then just provide two implementations of it, and do dependency injection depending on whether DAC is available on the given pin or not.

tannewt commented 6 years ago

Yeah, I agree using something like simple.tone would be better. I was under a time cruch so I just redid it. This does have the advantage of grabbing the resources once for the whole tune.

On Sat, Mar 24, 2018 at 4:16 AM Radomir Dopieralski < notifications@github.com> wrote:

I think it would be much cleaner to have a separate function (or class) for playing a specified tone for a specified duration (like Arduino's tone() for example), and then just provide two implementations of it, and do dependency injection depending on whether DAC is available on the given pin or not.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/adafruit/Adafruit_CircuitPython_RTTTL/pull/5#issuecomment-375874191, or mute the thread https://github.com/notifications/unsubscribe-auth/AADNqaUZ9QrhCHQP45N0pM1hICUW8L1Jks5thisAgaJpZM4S5Y7b .