BLYNK TEST

Dependencies:   mbed Blynk

Committer:
kenobi
Date:
Tue Jan 26 08:23:29 2021 +0000
Revision:
5:8a3cf73d7ed3
Parent:
3:4cd9171ba989
bLYNK

Who changed what in which revision?

UserRevisionLine numberNew contents of line
lixianyu 0:d8f4c441e032 1
lixianyu 3:4cd9171ba989 2 #include "ESP8266_HardSer.h"
lixianyu 3:4cd9171ba989 3 #include "BlynkSimpleShieldEsp8266_HardSer.h"
lixianyu 3:4cd9171ba989 4 #include "SimpleTimer.h"
lixianyu 0:d8f4c441e032 5
kenobi 5:8a3cf73d7ed3 6 Serial EspSerial(PA_9, PA_10);//tx, rx
lixianyu 0:d8f4c441e032 7 ESP8266 wifi(EspSerial);
lixianyu 0:d8f4c441e032 8
kenobi 5:8a3cf73d7ed3 9 void notify()
lixianyu 0:d8f4c441e032 10 {
kenobi 5:8a3cf73d7ed3 11 Blynk.notify("Alert : DOOR OPENED");
lixianyu 0:d8f4c441e032 12 }
lixianyu 0:d8f4c441e032 13
kenobi 5:8a3cf73d7ed3 14 BLYNK_WRITE(V1) {
kenobi 5:8a3cf73d7ed3 15 int a = param.asInt();
kenobi 5:8a3cf73d7ed3 16 if (a == 1) {
kenobi 5:8a3cf73d7ed3 17 Blynk.notify("BUKAK..");
kenobi 5:8a3cf73d7ed3 18
kenobi 5:8a3cf73d7ed3 19 }
kenobi 5:8a3cf73d7ed3 20 else {
kenobi 5:8a3cf73d7ed3 21 Blynk.notify("TUTUP...");
kenobi 5:8a3cf73d7ed3 22
kenobi 5:8a3cf73d7ed3 23
kenobi 5:8a3cf73d7ed3 24 }
lixianyu 3:4cd9171ba989 25 }