Ever forgot to turn off home lights while you were out and then you had to return all the way back home just to turn off lights? Well, that was quite frustrating, wasn't it? What if you never had to worry about it and you could just turn off lights from anywhere at anytime just by a single click? That''s possible, and Bolt IoT makes it even easier and possible just in some few simple steps.
Youtube link: https://youtu.be/N0eRi2qkZtU
Step 1] Add a new product to your Bolt IoT platform.
Step 2] Place a led on Breadboard, remember that the long end of led is positive while the short one is negative.
Step 3] Connect positive-end using a jumping wire to Pin 0 and connect negative-end using jumping wire to GND pin.
Step 4] Ensure stable connection and make sure both green and blue lights on WiFi module are stable.
Step 5] Configure the product on Bolt Platform and select Hardware configuration. Select Pin 0 and name the variable as led. Then go to the code section and save the file as led_control with extension html.
Step 6] Write the code given below in code section and save it.
<!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>
<centre>
<button onclick="digitalWrite(0, HIGH);">ON</button>
<button onclick="digitalWrite(0, LOW);">OFF</button>
</centre>
</body>
</html>
Step 7] Select the device from the home screen and click on monitor-like icon to view device. On clicking you will be directed to page containing two buttons ON and OFF.
Step 8] On clicking On the led will light up and on clicking OFF will turn off.
Thank you. Hope it helped you! :)
Comments