Hi, i have this code that will upload to my Wemos board, but it is not sending me notifications like “Open the door”. But it is sending me that esp was disconnected. Does anyone know how to solve this problem? The original code is for arduino uno Here
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
#include <pins_arduino.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "xxxxxxxxxxxxxxxxxxx";
SimpleTimer timer;
WidgetLCD lcd(V1);
void setup()
{
Serial.begin(9600);
Blynk.begin(auth, "xxxxx", "xxxxxx");
}
void notifyOnButtonPress()
{
// Invert state, since button is "Active LOW"
int isButtonPressed = !digitalRead(D5);
if (isButtonPressed) {
BLYNK_LOG("Button is pressed.");
Blynk.notify("Please open up! Somebody is on the door!");
lcd.clear(); //Use it to clear the LCD Widget
lcd.print(4, 0, "Open"); // use: (position X: 0-15, position Y: 0-1, "Message you want to print")
lcd.print(4, 1, "The Door!");
}
}
//
//void emailOnButtonPress()
//{
//
// int isButtonPressed = !digitalRead(D2); // Invert state, since button is "Active LOW"
//
// if (isButtonPressed) // You can write any condition to trigger e-mail sending
// {
// BLYNK_LOG("Button is pressed."); // This can be seen in the Serial Monitor
// Blynk.email("xxxxx@gmail.com", "Subject: Doorbell", "Please open up! Somebody is on the door!");
// lcd.clear(); //Use it to clear the LCD Widget
// lcd.print(4, 0, "Open"); // use: (position X: 0-15, position Y: 0-1, "Message you want to print")
// lcd.print(4, 1, "The Door!");
//
// }
//}
void loop()
{
Blynk.run();
timer.run();
}