สอนทำกล่องสมาทโฮมสั่งผ่านมือถือได้ทั่วโลก

แชร์
ฝัง
  • เผยแพร่เมื่อ 21 ก.ย. 2024

ความคิดเห็น • 6

  • @panpanchanel874
    @panpanchanel874 6 ปีที่แล้ว

    ทำแจ้งเตือนผ่านไลน์ต้องใส่โค็ตตัวใหนเพิ่มครับ

  • @sittichaitajanthuk7567
    @sittichaitajanthuk7567 4 ปีที่แล้ว

    ขอลิงค์ดาวโหลดโค๊ดหน่ยครับ

  • @tassanaipetcharanon3667
    @tassanaipetcharanon3667 6 ปีที่แล้ว

    โค๊ดตัวอย่างนี้ copy ได้จากไหนครับ

    • @tormaster9873
      @tormaster9873  6 ปีที่แล้ว

      /* Comment this out to disable prints and save space */
      #define BLYNK_PRINT Serial
      #include
      #include
      #include
      // You should get Auth Token in the Blynk App.
      // Go to the Project Settings (nut icon).
      char auth[] = "......ใส่โทเค้น......";
      // Your WiFi credentials.
      // Set password to "" for open networks.
      char ssid[] = ",,,,,,,ชื่อไวไฟ,,,,,,,,,";
      char pass[] = ".............รหัสไวไฟ..........";
      #define D1 5
      #define RL1 D1
      #define DHTPIN 2
      // Uncomment whatever type you're using!
      #define DHTTYPE DHT11 // DHT 11
      //#define DHTTYPE DHT22 // DHT 22, AM2302, AM2321
      //#define DHTTYPE DHT21 // DHT 21, AM2301
      DHT dht(DHTPIN, DHTTYPE);
      BlynkTimer timer;
      // This function sends Arduino's up time every second to Virtual Pin (5).
      // In the app, Widget's reading frequency should be set to PUSH. This means
      // that you define how often to send data to Blynk App.
      void sendSensor()
      {
      float h = dht.readHumidity();
      float t = dht.readTemperature(); // or dht.readTemperature(true) for Fahrenheit
      if (isnan(h) || isnan(t)) {
      Serial.println("Failed to read from DHT sensor!");
      return;
      }
      Blynk.virtualWrite(V5, h);
      Blynk.virtualWrite(V6, t);
      }
      // Keep this flag not to re-sync on every reconnection
      bool isFirstConnect = true;
      // This function will run every time Blynk connection is established
      BLYNK_CONNECTED() {
      if (isFirstConnect)
      // Request Blynk server to re-send latest values for all pins
      Blynk.syncAll();
      }
      void setup()
      {
      // Debug console
      Serial.begin(9600);
      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);
      pinMode(RL1,INPUT_PULLUP);
      dht.begin();
      // Setup a function to be called every second
      timer.setInterval(1000L, sendSensor);
      }
      void loop()
      {
      Blynk.run();
      timer.run();
      }

    • @sudtifangchonjit7928
      @sudtifangchonjit7928 6 ปีที่แล้ว

      ของผมไม่ผ่านครับ
      ขึ้นว่าBuild options changed, rebuilding all
      C:\Users\user\Documents\Arduino\esp8266001\esp8266001.ino:6:32: fatal error: BlynkSimpleEsp8266.h: No such file or directory
      #include
      ^
      compilation terminated.
      exit status 1
      Error compiling for board Generic ESP8266 Module.

    • @tormaster9873
      @tormaster9873  6 ปีที่แล้ว

      ถ้าไม่ได้ แอดไลน์มานะ audiais