raspberrypi / pico-sdk

BSD 3-Clause "New" or "Revised" License
3.27k stars 844 forks source link

Include pico_tone library #1569

Closed jcarranz97 closed 1 month ago

jcarranz97 commented 7 months ago

Fixes #1568

This PR includes tone functions to generate tones using PWM.

The tone function is similar to tone() from Arduino. I have also included a no_tone function to silence buzzer if needed.

I have a PR open in pico-examples repository which includes an example usage for this library.

Inspiration and References:

lurch commented 7 months ago

This might be better suited to https://github.com/raspberrypi/pico-extras than it is to pico-sdk ?

jcarranz97 commented 7 months ago

That is probably the best approach ...

Is the normal process first propose new libraries and examples against pico-extrasand pico-playground? If that is case, I can go ahead an move my PRs to those repos :eyes:

lurch commented 7 months ago

I believe the way it normally works is that if your example works out-of-the-box with the develop version of pico-sdk then you'd just submit it against pico-examples; but if your example relies on pico-extras then you'd submit it against pico-playground.

So in answer to your question: yes :smiley:

jcarranz97 commented 7 months ago

Thanks for the advice, I have just opened a PR against pico-extras to include this library there :muscle: https://github.com/raspberrypi/pico-extras/pull/70

peterharperuk commented 1 month ago

Not an sdk issue