Buzzer Not Working, Unable to Debug

Buzzer not Working.

My Connections are:

Long Pin of Buzzer to Pin 0 (Digital) (The one next to A0)
Short Pin of Buzzer to GND

Here’s my code:

Bolt IoT Platform
    <script type="text/javascript" src="https://cloud.boltiot.com/static/js/boltCommands.js"></script>
    
    <script>
        setKey('{{APIKEY}}','{{Name}}');
    </script>
</head>

<body>
    <center>
        <button onclick="digitalWrite(0,'HIGH');">On</button>
        <button onclick="digitalWrite(0,'LOW');">Off</button>
    </center>
</body>

Once try placing the buzzer b/w 3.3V or 5V and gnd and see whether it’s sounding or not.
If not, then the buzzer isn’t working.

1 Like

@simardeepsngh1 The syntax for setting the key is wrong. The correct syntax is,

<script type="text/javascript">setKey('{{ApiKey}}','{{Name}}');</script>

Try to change frequency of buzzer
If not working change buzzer
change “value” in code from 0-255