Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
NAVEEN RAJI EAPEN EC 17-21
Published

Control Light Intensity Using BOLT IOT Module

Learn how to use the BOLT IOT module to alter LED light intensity according to our needs using our smartphone or computer device.

BeginnerFull instructions provided460
Control Light Intensity Using BOLT IOT Module

Things used in this project

Hardware components

Bolt WiFi Module
Bolt IoT Bolt WiFi Module
×1
LED (generic)
LED (generic)
×1
Male/Male Jumper Wires
×1
Breadboard (generic)
Breadboard (generic)
×1

Software apps and online services

Bolt Cloud
Bolt IoT Bolt Cloud
Bolt IoT Android App
Bolt IoT Android App

Story

Read more

Schematics

Circuit Connections

Code

HTML code for PWM value interface and control.

HTML
Copy this code to the BOLT code window in your product tab.
<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

NAVEEN RAJI EAPEN EC 17-21
1 project • 0 followers
Contact

Comments

Please log in or sign up to comment.