Buzzer integration details
-
Hello,
I am trying to integrate a buzzer.
Can anyone advice, please, how is the best way to stop a started buzz ?
To start it, I use:
dac_tone.tone(1000, 0) # set tone output to 1kHzI do not know how to stop it . Also, it will be great to make a kind of intermitent beeps. Is this done by starting and stopping the buzzer ?
Thank you very much for your support,
-
@ClementN
if i understand corectly you have passive buzzer and you try to drive it with song.
you use dac for this?
I use pwm and this work like a charm :) -
@ClementN You can switch off the tone with dac.deinit(). Switching it back on requires:
dac.init() dac.tone(1000,0)The second parameter does not seem to change anything. The frequency is a little bit off. Setting a value of 1000 results in a frequency of 1024 Hz.
P.S.: Looking at the code in mods/pybdac.c, the second parameter is indeed ignored.
P.S.2: I added the few lines to handle the second parameter and will make a PR later on. The documentation must be adapted too. -
Thank you. @livius I will take a closer look into pwm
-
Thank you, @robert-hh looking forward for the workaround on parameter 2
-
@ClementN The PR is here: https://github.com/pycom/pycom-micropython-sigfox/pull/65
It shows also the minor change to the file pybdac.c and what you can expect from the change (which is just four different levels).
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login