PAWAN VISHWAKARMA
Published

LED control

Imagine you are watching a movie on your laptop and you want to turn off the light of the room to get the feel of a movie hall. Then

BeginnerFull instructions provided212
LED control

Things used in this project

Hardware components

Bolt WiFi Module
Bolt IoT Bolt WiFi Module
×1
LED (generic)
LED (generic)
×1
Resistor 330 ohm
Resistor 330 ohm
×1
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×2

Software apps and online services

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

Story

Read more

Schematics

c_xF4NsJKn3r.jpg

Code

User Interface Design

HTML
In the header, we will include a javascript file which has some pre-defined function like DigitalRead, digitalWrite etc already hosted on our Bolt Cloud. and API key and Device name will be auto-initialized by Bolt cloud. You don't have to replace the device name and API key in the code and in body section we have include the the <body> tag you have to place two buttons, one for turning the LED on and other to turn it off.
<!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>
        <button onclick="digitalWrite(0, 'LOW');">OFF</button>
        </center>
    </body>
</html>

Credits

PAWAN VISHWAKARMA
1 project • 0 followers

Comments