Skip to content

Instantly share code, notes, and snippets.

@maxpromer
Created August 22, 2025 14:55
Show Gist options
  • Save maxpromer/5130fe9be2f2907b74a9ea65f11716ec to your computer and use it in GitHub Desktop.
Save maxpromer/5130fe9be2f2907b74a9ea65f11716ec to your computer and use it in GitHub Desktop.
#include <TinkerC6.h> // เรียกใช้ไลบรารี่ Tinker C6
void setup() {
Serial.begin(115200); // เริ่มใช้งาน Serial Monitor
TinkerC6.RS485.begin(9600); // เริ่มใช้งาน RS485
}
void loop() {
TinkerC6.RS485.enable(); // เปิดใช้งานส่วน RS485
TinkerC6.RS485.println("Hello, RS485 !"); // ส่งข้อความออก RS485
TinkerC6.RS485.flush(); // รอจนกว่าจะส่งข้อความผ่าน RS485 เสร็จ
TinkerC6.RS485.disable(); // ปิดใช้งานส่วน RS485
TinkerC6.Power.enterToLightSleep(1000); // หน่วงเวลา 1 วินาที ด้วย Light Sleep Mode
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment