Skip to content

Instantly share code, notes, and snippets.

View maxpromer's full-sized avatar

Max maxpromer

View GitHub Profile
LINE_Messaging_Massage_Option_t option; // สร้างตัวแปร option
// ดูรายการสติ๊กเกอร์ที่รองรับได้ที่ https://developers.line.biz/en/docs/messaging-api/sticker-list/
option.sticker.package_id = 446; // สติ๊กเกอร์ Package ID
option.sticker.id = 1988; // สติ๊กเกอร์ ID
if (LINE.send("User ID/Group ID", "รถโดนขโมย", &option)) { // ส่งข้อความ "รถโดนขโมย" ไปที่ LINE
Serial.println("Send notify successful"); // ส่งข้อความ "Send notify successful" ไปที่ Serial Monitor
} else { // ถ้าส่งไม่สำเร็จ
Serial.printf("Send notify fail. check your token (code: %d)\n", LINE.status_code); // ส่งข้อความ "Send notify fail" ไปที่ Serial Monitor
#include <WiFi.h> // นำเข้าไลบรารี่ WiFi
#include <ArtronShop_LineMessaging.h> // นำเข้าไลบารี่ ArtronShop_LineMessaging
const char* ssid = "WiFi Name"; // ชื่อ WiFi
const char* password = "WiFi Password"; // รหัสผ่าน WiFi
#define LINE_TOKEN "LINE Token" // Channel access token
void setup() {
Serial.begin(115200); // เริ่มต้นใช้ Serial ที่ความเร็ว 115200
while (!Serial) { delay(100); }
if (LINE.send("User ID/Group ID", "รถโดนขโมย")) { // ถ้าส่งข้อความ "รถโดนขโมย" ไปที่ LINE สำเร็จ
Serial.println("Send notify successful"); // ส่งข้อความ "Send notify successful" ไปที่ Serial Monitor
} else { // ถ้าส่งไม่สำเร็จ
Serial.printf("Send notify fail. check your token (code: %d)\n", LINE.status_code); // ส่งข้อความ "Send notify fail" ไปที่ Serial Monitor
}
LINE.begin(<Channel access token>); // เริ่มต้นใช้ LINE Messaging API กำหนด Channel access 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 <ArtronShop_LineMessaging.h> // นำเข้าไลบารี่ ArtronShop_LineMessaging
@maxpromer
maxpromer / P4-P5_RGB_DotMatrix_Test.ino
Created February 17, 2025 16:59
P4 P5 RGB Dot Matrix 64x32 Test Code
#include <Arduino.h>
#include <Adafruit_GFX.h>
#include <Adafruit_Protomatter.h>
// Matrix Pin Configs
uint8_t rgbPins[] = { 42, 41, 40, 39, 38, 37 };
uint8_t addrPins[] = { 36, 35, 46, 48 };
uint8_t clockPin = 47;
uint8_t latchPin = 21;
uint8_t oePin = 2;

Arduino 3.x

Arduino 3.x is not officially suported by PlatformIO - see platformio/platform-espressif32#1225

Due to the lack of further development of the Espressif 32 Arduino Core for PlatformIO, the pioarduino fork was created.

Arduino 3.1.x

platform-espressif32 Arduino Core based on ESP-IDF platformio.ini
#define RELAY_PIN (5) // ขาที่ต่อรีเลย์
void setup() {
pinMode(RELAY_PIN, OUTPUT);
}
void loop() {
digitalWrite(RELAY_PIN, LOW); // สั่งโซลินอยด์ทำงาน
delay(2000);
digitalWrite(RELAY_PIN, HIGH); // สั่งโซลินอยด์หยุดทำงาน
@maxpromer
maxpromer / MAX31865_test.ino
Created January 1, 2025 07:28
MAX31865 โมดูลแปลงสัญญาณ RTD PT100 PT1000 : https://www.artronshop.co.th/p/684
/***************************************************
This is a library for the Adafruit PT100/P1000 RTD Sensor w/MAX31865
Designed specifically to work with the Adafruit RTD Sensor
----> https://www.adafruit.com/products/3328
This sensor uses SPI to communicate, 4 pins are required to
interface
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing