CHAITHANYA SAI
Published © GPL3+

How to control buzzer by using bolt wifi module

In this project I am discussing about how to control buzzer using bolt wifi module

BeginnerFull instructions provided2 hours149
How to control buzzer by using bolt wifi module

Things used in this project

Hardware components

Buzzer
Buzzer
×1
Bolt WiFi Module
Bolt IoT Bolt WiFi Module
×1
USB-A to Mini-USB Cable
USB-A to Mini-USB Cable
×1

Software apps and online services

Bolt Cloud
Bolt IoT Bolt Cloud

Story

Read more

Custom parts and enclosures

How to control buzzer by using bolt wifi module

Schematics

How to control buzzer by using bolt wifi module

Code

How to control buzzer by using bolt wifi module

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}}');

        var last_pwm_value=-1;
        function updateBuzzer(){
            var pwm_value=document.getElementById('pwm_value').value;
            if(last_pwm_value!=pwm_value){
                analogWrite(0,pwm_value);
                document.getElementById('pwm_value_display').innerHTML=pwm_value;
            }
            last_pwm_value=pwm_value;
        }
        setInterval(updateBuzzer,1000);
        </script>
    </head>
    <body>
        pwm value:
        <input type='range' id='pwm_value' min="0" max="255" value="0">
        <div id='pwm_value_display'>0</div>
    </body>

</html>

Credits

CHAITHANYA SAI

CHAITHANYA SAI

1 project • 0 followers

Comments