Skip to content

Instantly share code, notes, and snippets.

View maxpromer's full-sized avatar

Max maxpromer

View GitHub Profile
Alert.begin(<Room token>); // เริ่มต้นใช้ Am Alert กำหนด ROOM token
#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
#include <AmAlert.h> // นำเข้าไลบารี่ AmAlert
#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() {
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);
}
#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
#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); }
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
#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); }
#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); }