This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DigitalInOut DHT22(PA_10); // กำหนดขาใช้งานต่อ DHT22 | |
| uint16_t humi,temp; // ประกาศตัวแปร เพื่อเก็บข้อมูล humi และ temp | |
| bool DHT22_READ() { // ตัวอย่างฟังก์ชั่นอ่านข้อมูล | |
| uint8_t data [5]; // สร้างตัวแปรเพื่อเก็บ Data protocol | |
| DHT22.output(); // กำหนดให้ GPIO นั้นเป็น output | |
| DHT22.write(0); // สั่งให้ GPIO ส่ง logic low | |
| wait_ms(18); // รอ 18ms |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "mbed.h" | |
| Serial pc(SERIAL_TX, SERIAL_RX); | |
| DigitalInOut DHT22(PA_10); | |
| uint16_t humi,temp; | |
| bool DHT22_READ() { // ตัวอย่างฟังก์ชั่นอ่านข้อมูล | |
| uint8_t data [5]; // สร้างตัวแปรเพื่อเก็บ Data protocol | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define dataPin 8 | |
| #define latchPin 9 | |
| #define clockPin 10 | |
| void setup() { | |
| pinMode(dataPin,OUTPUT); //set output | |
| pinMode(latchPin,OUTPUT); //set output | |
| pinMode(clockPin,OUTPUT); //set output | |
| } | |
| void loop() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mail.smtp.auth=true | |
| mail.smtp.starttls.enable=true | |
| mail.smtp.host=smtp.gmail.com | |
| mail.smtp.port=587 | |
| mail.smtp.username=example@gmail.com | |
| mail.smtp.password= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/local/bin/python | |
| # -*- coding: utf-8 -*- | |
| def lineNotify(message): | |
| payload = {'message':message} | |
| return _lineNotify(payload) | |
| def notifyFile(filename): | |
| file = {'imageFile':open(filename,'rb')} | |
| payload = {'message': 'test'} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private void notifyPicture(string url) | |
| { | |
| _lineNotify(" ", 0, 0, url); | |
| } | |
| private void notifySticker(int stickerID, int stickerPackageID) | |
| { | |
| _lineNotify(" ", stickerPackageID, stickerID, ""); | |
| } | |
| private void lineNotify(string msg) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * By JackRoboticS | |
| * www.jackrobotics.me | |
| */ | |
| #include <Wire.h> | |
| byte ADDRESS_PCF8574 = 0B0100000 | 0B000; //address 000 | |
| //byte ADDRESS_PCF8574 = 0B0100000 | 0B001; //address 001 | |
| //byte ADDRESS_PCF8574 = 0B0100000 | 0B010; //address 010 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * By JackRoboticS | |
| * www.jackrobotics.me | |
| */ | |
| #include "Wire.h" | |
| TwoWire WIRE(0); | |
| byte ADDRESS_PCF8574 = 0B0100000 | 0B000; //address 000 | |
| //byte ADDRESS_PCF8574 = 0B0100000 | 0B001; //address 001 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <WiFi.h> | |
| #include <iSYNC.h> | |
| WiFiClient client; | |
| iSYNC iSYNC(client); | |
| String ssid = "HONEYLab"; | |
| String pass = "@HONEYLab"; | |
| String iSYNC_USERNAME = "admin"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var google_sheet_key = "1cKJitUdOQtGzUkurXhgsxY3_MON7wV9cguLGs5JC3hE"; | |
| var google_sheet_name = "แผ่น1"; | |
| function doGet(e){ | |
| var sheet = SpreadsheetApp.openById(google_sheet_key).getSheetByName(google_sheet_name); | |
| var temp = Number(e.parameter.temp); | |
| var humi = Number(e.parameter.humi); | |
| sheet.appendRow([new Date(),temp,humi]); | |
| } |