Skip to content

Commit

Permalink
สั่งรีเซตด้วย V7 แล้วไฟแอพไม่ดับ
Browse files Browse the repository at this point in the history
  • Loading branch information
Remy Martin committed Sep 13, 2020
1 parent f99e6a3 commit 0a534e6
Showing 1 changed file with 90 additions and 0 deletions.
90 changes: 90 additions & 0 deletions ESP8266/Reset_all_By_V7/Reset_all_By_V7.ino
@@ -0,0 +1,90 @@
/* Comment this out to disable prints and save space */
#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[] = "xxxxxxxxxx";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "xxxxxxxx";
char pass[] = "xxxxxxxxx";


void output ()
{
digitalWrite(D3, HIGH);
}

void output1 ()
{
digitalWrite(D3, LOW);
}

void output2 ()
{
digitalWrite(D0, HIGH);
}

void output3 ()
{
digitalWrite(D0, LOW);
}


BLYNK_WRITE(V5) // Button Widget writes to Virtual Pin V5
{
if(param.asInt()== 1) { // if Button sends 1
output(); // start the function
}
if(param.asInt()== 0) { // if Button sends 1
output1(); // start the function
}
}

BLYNK_WRITE(V6) // Button Widget writes to Virtual Pin V5
{
if(param.asInt()== 1) { // if Button sends 1
output2(); // start the function
}
if(param.asInt()== 0) { // if Button sends 1
output3(); // start the function
}
}


BLYNK_WRITE(V7) // Button Widget writes to Virtual Pin V5
{
if(param.asInt()== 1) { // if Button sends 1
output3(); // start the function
output1();

}
}




void setup()
{
pinMode (D3, OUTPUT);
pinMode (D0, OUTPUT);
// Debug console
Serial.begin(9600);

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

void loop()
{
Blynk.run();

}

0 comments on commit 0a534e6

Please sign in to comment.