Skip to content

Instantly share code, notes, and snippets.

@maxpromer
Created April 13, 2025 18:30
Show Gist options
  • Save maxpromer/d65a3e3743a17e98456e727b528003fc to your computer and use it in GitHub Desktop.
Save maxpromer/d65a3e3743a17e98456e727b528003fc to your computer and use it in GitHub Desktop.
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
if (Alert.send("รถโดยขโมย", &option)) { // ถ้าส่งข้อความ "รถโดนขโมย" ไปที่ Am Alert สำเร็จ
Serial.println("Send notify successful"); // ส่งข้อความ "Send notify successful" ไปที่ Serial Monitor
} else { // ถ้าส่งไม่สำเร็จ
Serial.printf("Send notify fail. check your token (code: %d)\n", Alert.status_code); // ส่งข้อความ "Send notify fail" ไปที่ Serial Monitor
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment