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
Alert.begin(<Room token>); // เริ่มต้นใช้ Am Alert กำหนด ROOM token |
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> // นำเข้าไลบรารี่ WiFi | |
const char* ssid = "your-ssid"; // ชื่อ WiFi | |
const char* password = "your-password"; // รหัสผ่าน WiFi | |
void setup() { | |
Serial.begin(115200); // เริ่มต้นใช้ Serial ที่ความเร็ว 115200 | |
while(!Serial){delay(100);} | |
// We start by connecting to a WiFi network |
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 <AmAlert.h> // นำเข้าไลบารี่ AmAlert |
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> // นำเข้าไลบรารี่ WiFi | |
#include <AmAlert.h> // นำเข้าไลบารี่ AmAlert | |
const char* ssid = "WiFi Name"; // ชื่อ WiFi | |
const char* password = "WiFi Password"; // รหัสผ่าน WiFi | |
#define ROOM_TOKEN "ROOM Token" // ROOM Token | |
#define PIR_PIN (27) // กำหนดขาต่อเซ็นเซอร์ PIR | |
void setup() { |
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
Am_Alert_Massage_Option_t option; // สร้างตัวแปร option | |
option.image.url = "https://img2.pic.in.th/pic/IMG20230921232431.jpeg"; // ลิ้งรูป ไฟล์ JPEG ขนาดไม่เกิน 2048×2048px | |
if (Alert.send("User ID/Group ID", "รถโดยขโมย", &option)) { // ส่งข้อความ "รถโดนขโมย" ไปที่ Am Alert | |
Serial.println("Send notify successful"); | |
} else { | |
Serial.printf("Send notify fail. check your token (code: %d)\n", Alert.status_code); | |
} |
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 <WiFiManager.h> // นำเข้าไลบรารี่ WiFiManager | |
#include <AmAlert.h> // นำเข้าไลบารี่ AmAlert | |
#define ROOM_TOKEN "your ROOM token" // Room Token | |
WiFiManager wm; | |
void setup() { | |
Serial.begin(115200); // เริ่มต้นใช้ Serial ที่ความเร็ว 115200 | |
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> // นำเข้าไลบรารี่ WiFi | |
#include <AmAlert.h> // นำเข้าไลบารี่ AmAlert | |
const char* ssid = "WiFi Name"; // ชื่อ WiFi | |
const char* password = "WiFi Password"; // รหัสผ่าน WiFi | |
#define ROOM_TOKEN "ROOM Token" // ROOM Token | |
void setup() { | |
Serial.begin(115200); // เริ่มต้นใช้ Serial ที่ความเร็ว 115200 | |
while (!Serial) { delay(100); } |
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
Am_Alert_Massage_Option_t option; // สร้างตัวแปร option | |
// ตั้งค่าส่งแผนที่ | |
option.map.service = LONGDO_MAP; // ใช้แผนที่จาก Longdo Map | |
// option.map.service = GOOGLE_MAP; // ใช้แผนที่จาก Google Map | |
option.map.lat = 13.91024; // ละติจูด | |
option.map.lng = 100.51108; // ลองจิจูด | |
option.map.zoom = 20; // ระยะซูม กำหนดได้ 1 - 20 | |
// option.map.api_key = "Google Map API Key"; // กรอก API Key หากใช้ Google Map |
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> // นำเข้าไลบรารี่ WiFi | |
#include <AmAlert.h> // นำเข้าไลบารี่ ArtronShop_LineMessaging | |
const char* ssid = "WiFi Name"; // ชื่อ WiFi | |
const char* password = "WiFi Password"; // รหัสผ่าน WiFi | |
#define ROOM_TOKEN "your ROOM token" // Room Token | |
void setup() { | |
Serial.begin(115200); // เริ่มต้นใช้ Serial ที่ความเร็ว 115200 | |
while (!Serial) { delay(100); } |
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> // นำเข้าไลบรารี่ WiFi | |
#include <AmAlert.h> // นำเข้าไลบารี่ AmAlert | |
const char* ssid = "WiFi Name"; // ชื่อ WiFi | |
const char* password = "WiFi Password"; // รหัสผ่าน WiFi | |
#define ROOM_TOKEN "Room Token" // Room Token | |
void setup() { | |
Serial.begin(115200); // เริ่มต้นใช้ Serial ที่ความเร็ว 115200 | |
while (!Serial) { delay(100); } |
NewerOlder