Issue with buzzer programming

please send me the programming for buzzer with frequancy change.

1 Like

Hi @djayak1996,

The code for buzzer control

<html>
<head>
  <!-- In following  line will load the boltCommands.js files from Bolt cloud.-->
  <script type="text/javascript" src="https://cloud.boltiot.com/static/js/boltCommands.js">
  </script>

  <script type="text/javascript">
    // The following line will set the api key and device name. It will be auto-initialized by Bolt cloud.
    setKey('{{ApiKey}}','{{Name}}');
</script>

</head>
<body>
<center>
  <!-- In below line, We are calling the digitalWrite function from  boltCommands.js file to switch on the LED. -->
  <button onclick="analogWrite(0, 'A0');">ON</button>

  <!-- In below line, we are calling the digitalWrite function from boltCommands.js file to switch off the LED. -->
  <button onclick="analogWrite(0, 'A0');">OFF</button>

</center>
</body>
</html>

Please try the debugging method that I has explained in other thread.

<!DOCTYPE html>
<html>
    <head>
        <title>Bolt IoT Platform</title>
        <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>
        <form>
              Frequency :<br>
              <input type="number" name="frequency" min=0,max=255>
               <button onclick="digitalWrite(0, 'high');">ENTER</button>
                </form>
        <button onclick="digitalWrite(0, 'LOW');">OFF</button>
        </center>
    </body>
</html>