Commande de relais dont 1 avec une minuterie


#define BLYNK_PRINT Serial


#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

SimpleTimer timer;



// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "dBF8kYGP7wc40_odN-CS3OdLqowsqDjp"; //You will get this Auth Token in Gmail if you signin Blynk app with your Gmail ID

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "****"; //Enter your WIFI Name
char pass[] = "****";//Enter your WIFI Password




void setup()
{
  // Debug console
  Serial.begin(9600);
  pinMode(D1,OUTPUT); //radiateur
  pinMode(D2,OUTPUT);
  pinMode(D3,OUTPUT);
  pinMode(D4,OUTPUT);

  digitalWrite(D1,LOW);  //radiateur
  digitalWrite(D2,LOW);
  digitalWrite(D2,LOW);
  digitalWrite(D3,LOW);
  digitalWrite(D4,LOW);
  
  

  Blynk.begin(auth, ssid, pass);
  // You can also specify server:
  //Blynk.begin(auth, ssid, pass, "blynk-cloud.com", 8442);
  //Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8442);

if (pinMode(D1) >0)
{
  timer.setTimer(5000L);
digitalWrite(D2,LOW);   // eteindre le radiateur
}
    
    }

void loop()
{
  Blynk.run();
  timer.run();

  }  ~~~~
1 Like