How to stop Buzzer

57%20PM

Once this piece of code runs the buzzer continuously beeps. I just wanted to know how to stop the buzzer.

change from the third line of the code as follows:

buzzer_action(1,"HIGH")
time.sleep(10)
buzzer_action(1, "LOW")

This gives no output at port 1 which makes the buzzer turn off instantly.

For stopping the buzzer’s beep sound, you must give Low output instead of High one.
For this , you must add the following code after third line .

      time.sleep(10)
      buzzer_action(1, "LOW")

By adding those lines, you can stop the beep sound.

This post was flagged by the community and is temporarily hidden.