Posted on

Project เปิด/ปิดไฟด้วย Blynk + ESP8285

สวัสดีครับสำหรับ Post นี้เราจะมาสร้าง Project  เปิด/ปิดไฟด้วย Blynk ผ่านอุปกรณ์ ESP8285 กัน ซึ่งก่อนการเริ่มต้นให้ตรวจสอบก่อนว่าเรามีสิ่งที่จำเป็นครบหรือยัง ดังนี้ครับ

ใน Project นี้จะทำการต่อหลอด LED จำนวน 3 หลอดเข้ากับขา 2,4 และ 5 นะครับ

ขั้นตอนทั้งหมดสามารถดูจาก VDO ได้เลยครับ

Source Code ของตัวโปรแกรม

/* 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[] = "YOUR-BLYNK-AUTH";

// Your WiFi credentials.
char ssid[] = "WiFi-SSID";
char pass[] = "WiFi-PASSWORD";

void setup()
{
  // Debug console
  Serial.begin(9600);

  //Blynk.begin(auth, ssid, pass);
  Blynk.begin(auth, ssid, pass,"blynk.jpnet.co.th",8080);
  Blynk.syncAll();
}

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