Szymon MasternakAndrew BerrySpiveyAdam O' CeallaighJack Duff
Published © GPL3+

IoT Morning Alarm Using Dot One and Grove Module

Ever overslept and never got the chance to inform your boss about being late? With this project you can do exactly this!

IntermediateFull instructions provided2 hours588
IoT Morning Alarm Using Dot One and Grove Module

Things used in this project

Hardware components

Wia Dot One
Wia Dot One
×1
Wia Micro USB Cable
Wia Micro USB Cable
×1
Wia Grove Connector Module
×1

Software apps and online services

Wia
Wia

Story

Read more

Code

Code for Wia Code Editor

C/C++
#include <WiFi.h>
#include <Wia.h>

long startcountingtime;

Wia wiaClient = Wia();

void setup() {
  WiFi.begin();
  delay(2500);
  pinMode(26, OUTPUT);
  pinMode(19, INPUT);
}

void loop() {
  startcountingtime = millis();
  while ((wiaClient.getDeviceState("state")) == "alarm-on") {
    digitalWrite(26, HIGH);
    delay(50);
    digitalWrite(26, LOW);
    delay(15);
    if (digitalRead(19)) {
      wiaClient.createEvent("button-pressed");
      delay(1000);
    }
    if (millis() - startcountingtime > 60000) {
      wiaClient.createEvent("alarm-stop");
      delay(1000);
    }
  }
  delay(10000);

}

Code For Function

JavaScript
var d = new Date();
var n = d.getDay();

if (n < 6 && n>0){
  output.process = true;
}
else {
	output.process = false;
}

Credits

Szymon Masternak
6 projects • 5 followers
Contact
Andrew Berry
25 projects • 11 followers
Contact
Spivey
82 projects • 59 followers
Tourist in a Tutu || US Born || Melbourne/Mexico/California Raised || New Yorker at ❤️ || SF to Dublin to be COO of Wia the best IoT startup
Contact
Adam O' Ceallaigh
20 projects • 8 followers
Contact
Jack Duff
32 projects • 8 followers
Man of the people. Champion of the downtrodden. Marketing magic @ Wia. Becoming a maker by learning, building, and exploring
Contact

Comments

Please log in or sign up to comment.