How to make a buzzer buzz during the code?

I have connected the buzzer to 1 pion and ground. Now, in the python code how do I make the current flow through it when the condition gets satisfied??

@chirag.g.987
You can simply use the if statement with your condition mentioned in it. Use inside if mybolt.digitalWrite(‘0’, ‘HIGH’) ,this will let you flow current through buzzer and instead of 0 you can use any GPIO pin.

1 Like

@chirag.g.987 Send a HIGH command via the API and it will turn on and send voltage through the selected pin.
If you want to switch it off, send a LOW command.

You can use if conditions. The condition should be mybolt.digitalWrite(‘0’, ‘HIGH’). Remember this is a case sensitive