Hello,
I’ve got a problem with my project. I have written a code (see below), it works without problems on the Wemos R1 mini. But when I load the sketch on the ESP8266 e01 it doesn’t work.
I can upload the sketch without any problems and the IDE says every thing is fine.
The ESP is connected to my Lab Bench power supply, so it has enough power (current), but it only takes 30 to 50 mA
Could it be the dalay() function? But why it works on the Wemos R1?
Could anybody please help?
#define BLYNK_PRINT Serial
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "my key";
// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "my Wifi";
char pass[] = "*************";
int Sensor = 2;
int Status = 0;
int Validierung = 0;
void setup()
{
pinMode(Sensor, INPUT);
Serial.begin(9600);
Blynk.begin(auth, ssid, pass);
Blynk.run();
}
void loop()
{
Status = digitalRead(Sensor);
Serial.print(Status);
if(Status == HIGH)
{
Validierung = Validierung + 1;
delay(1000);
}
if(Status == HIGH)
{
Validierung = Validierung + 1;
}
if(Validierung == 2)
{
Serial.print("Feuer");
Blynk.notify("Feuer");
}
Serial.print("Deep Sleep");
ESP.deepSleep(0);
}