Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Buzzer integration details

    Scheduled Pinned Locked Moved Discussion
    dacbeepbuzzer
    6 Posts 3 Posters 1.7k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C Offline
      ClementN
      last edited by

      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 1kHz

      I 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,

      L robert-hhR 2 Replies Last reply Reply Quote 0
      • L Offline
        livius @ClementN
        last edited by

        @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 :)

        think about people first, then computers

        C 1 Reply Last reply Reply Quote 0
        • robert-hhR Offline
          robert-hh @ClementN
          last edited by robert-hh

          @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.

          C 1 Reply Last reply Reply Quote 1
          • C Offline
            ClementN @livius
            last edited by

            Thank you. @livius I will take a closer look into pwm

            1 Reply Last reply Reply Quote 0
            • C Offline
              ClementN @robert-hh
              last edited by

              Thank you, @robert-hh looking forward for the workaround on parameter 2

              robert-hhR 1 Reply Last reply Reply Quote 0
              • robert-hhR Offline
                robert-hh @ClementN
                last edited by

                @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).

                1 Reply Last reply Reply Quote 1

                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
                • 1 / 1
                • First post
                  Last post

                Pycom on Twitter

                Pycom