Pamidi Mohammad Sohail
Published © GPL3+

Desk Buddy Using Bolt

Simple iot project using Bolt module. Best toy to tell your presence.

BeginnerProtip2 hours192
Desk Buddy Using Bolt

Things used in this project

Hardware components

Bolt WiFi Module
Bolt IoT Bolt WiFi Module
×1
LED (generic)
LED (generic)
×2

Software apps and online services

Bolt Cloud
Bolt IoT Bolt Cloud

Story

Read more

Schematics

Circuit connections

Code

Code

HTML
Paste the below code in you code part in bolt cloud.
<html>
<head>
<style>
.buttonPresent {
    background-color: #52BE80 ;
    border: none;
    color: white;
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
    border-radius: 12px;
}

.buttonAbsent {
    background-color: #E74C3C;
    border: none;
    color: white;
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
    border-radius: 12px;
}

</style>
  <!-- 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}}');
    setDebug(false);
    // Function defination for employee Presence
    function present(){
        digitalWrite(0, 'HIGH');
        digitalWrite(1,'LOW');
    }
    // Function defination for employee Absence
    function absent(){
      digitalWrite(0, 'LOW');
      digitalWrite(1,'HIGH');
      digitalWrite(2,'LOW'); 
    }
</script>
</head>

<body>
    <div class="background">
<center>
  <!-- In below line, We are calling the 'present' function defined in the javascript above,
  to switch on the Green LED. -->
  <button onclick="present()" class="buttonPresent">Present</button>

  <!-- In below line, we are calling the 'absent' function defined in the javascript above,
  to switch on the RED LED. -->
  <button onclick="absent()" class="buttonAbsent">Away</button>

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

Credits

Pamidi Mohammad Sohail

Pamidi Mohammad Sohail

1 project • 0 followers

Comments