#define BLYNK_PRINT Serial
#include <SPI.h>
#include <Ethernet.h>
#include <BlynkSimpleEthernet.h>
#include <SimpleTimer.h>
#define motion 2 // Motion sensor connected to pin 2 of arduino
char auth[] = "";
SimpleTimer timer;
WidgetLCD lcd(V1);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(2,INPUT);
Blynk.begin(auth);
while (Blynk.connect() == false) {
// Wait until connected
}
}
void loop() {
// put your main code here, to run repeatedly:
Blynk.run();
timer.run();
if(motion == 1)
{
Blynk.email("xxx@gmail.com", "Subject: Security", "Please Check! Something fishy!");
lcd.clear(); //Use it to clear the LCD Widget
lcd.print(4, 0, "Check"); // use: (position X: 0-15, position Y: 0-1, "Message you want to print")
lcd.print(4, 1, "The House!");
Blynk.notify("Check the House!!!!!!");
}
}
Comments