BLYNK TEST

Dependencies:   mbed Blynk

Revision:
5:8a3cf73d7ed3
Parent:
3:4cd9171ba989
--- a/WiFiBlynk.h	Thu Jun 16 08:12:33 2016 +0000
+++ b/WiFiBlynk.h	Tue Jan 26 08:23:29 2021 +0000
@@ -1,30 +1,25 @@
 
-#include "Config.h"
 #include "ESP8266_HardSer.h"
 #include "BlynkSimpleShieldEsp8266_HardSer.h"
 #include "SimpleTimer.h"
 
-Serial EspSerial(D3, D2);//tx, rx
+Serial EspSerial(PA_9, PA_10);//tx, rx
 ESP8266 wifi(EspSerial);
 
-void senTempHumi()
+void notify()
 {
-    Blynk.virtualWrite(V2, sensor_tem);
-    Blynk.virtualWrite(V3, sensor_hum);
+    Blynk.notify("Alert : DOOR OPENED");
 }
 
-BLYNK_READ(V4)
-{
-    Blynk.virtualWrite(V4, sensor_light);
-}
-BLYNK_READ(V5)
-{
-    Blynk.virtualWrite(V5, Sensor_etoh);
-    //BLYNK_PRINT.println(Sensor_etoh);
-}
-
-BLYNK_READ(V6)
-{
-    Blynk.virtualWrite(V6, sensorPM25);
-    //BLYNK_PRINT.println(sensorPM25);
+BLYNK_WRITE(V1) { 
+  int a = param.asInt(); 
+  if (a == 1) { 
+    Blynk.notify("BUKAK..");     
+    
+  }  
+  else { 
+    Blynk.notify("TUTUP...");
+ 
+  
+  } 
 }
\ No newline at end of file