Skip to content

Instantly share code, notes, and snippets.

/*
* ไลบรารี่ TridentTD_LineNotify version 2.1
* ใช้สำหรับ ส่ง แจ้งเตือนไปยัง LINE สำหรับ ESP8266 และ ESP32
* สามารถส่งได้ทั้ง ข้อความ , สติกเกอร์ และรูปภาพ(ด้วย url)
* -----------------------------------------------------
* ให้ save เป็น file ต่างหากก่อนถึงจะส่ง Line Notify ภาษาไทยได้
*/
#include <TridentTD_LineNotify.h>
@9arduino
9arduino / Examples Tree.ino
Last active April 23, 2025 13:54
ตัวอย่างโปรเจค รดน้ำต้นไม้อัตโนมัติ การต่ออุปกรณ์ อ่านเพิ่มเติมได้ใน Link https://www.ab.in.th/b/10
/*
ตัวอย่างโปรเจค รดน้ำต้นไม้อัตโนมัติ การต่ออุปกรณ์
อ่านเพิ่มเติมได้ใน Link https://www.ab.in.th/b/10
การต่อวงจร https://dx.lnwfile.com/_/dx/_raw/nf/s5/ew.png
*/
const int analogInPin = A5;
const int relay = 2;
int sensorValue = 0; // ตัวแปรค่า Analog
@9arduino
9arduino / Examples Gas MQ2 Arduino.ino
Last active April 23, 2025 14:03
การต่ออุปกรณ์ สามารถอ่านเพิ่มได้ที่ Link : https://www.ab.in.th/b/12
/*
การต่ออุปกรณ์ สามารถอ่านเพิ่มได้ที่ Link : https://www.ab.in.th/b/12
*/
int LedRED = 12;
int LEDgreen = 11;
int smokeA0 = A0;
int sensorThres = 400; //ตั้ง ค่าความหนาของตวัน แก๊ส ก๊าซที่ 400
@9arduino
9arduino / DS18B20.ino
Last active April 23, 2025 14:02
วิธีการใช้งาน Sensor DS18B20 Arduino วัดอุณหภูมิในน้ำ https://www.ab.in.th/b/18
/*
วิธีการใช้งาน Sensor DS18B20 Arduino วัดอุณหภูมิในน้ำ
บทความ จาก https://www.ab.in.th/b/18
*/
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 2 //กำหนดขา
@9arduino
9arduino / OnewireKeypad.ino
Last active April 23, 2025 14:01
การต่อ Keypad 4*4 แบบเส้นเดียว เชื่อมต่อ Arduino One wire https://www.ab.in.th/b/29
/*
จากบทความ https://www.ab.in.th/b/29
*/
#include <OnewireKeypad.h>
char KEYS[] = {
'1', '2', '3', 'A',
'4', '5', '6', 'B',
'7', '8', '9', 'C',
@9arduino
9arduino / App Nodemcu Relay.ino
Last active April 23, 2025 14:04
NodeMCU Esp8266 เปิดปิดไฟควบคุมผ่าน App มือถือ
/* ตัวอย่าง โดย https://www.ab.in.th เขียนเอง
การต่อสาย
ขา D1 SCL
ขา D2 SDA
ขา Vin VCC ของจอ LCD
ขา GND GND ของจอ LCD
ขา Vin VCC ของ Relay
ขา GND GND ของ Relay
ขา D0 IN1 ของ Relay
@9arduino
9arduino / Oscilloscope.ino
Last active April 23, 2025 14:00
จำลอง Arduino เป็น Oscilloscope สำหรับวัดสัญญาณ https://www.ab.in.th/b/17
/*
บทความจาก Link https://www.ab.in.th/b/17
*/
const int analogInPin1 = A0;
static int ctr,flag_tog;
static unsigned char adcval;
void setup()
{
Serial.begin(115200);
/*
Arduino RC Car Drift
By Pakorn Rattanaying
https://www.ab.in.th/
ตามบทความ https://www.ab.in.th/b/26
*/
#include <ESP8266WiFi.h>
#include <WiFiUDP.h>
void Line_Notify(String message) ;
#include <ESP8266WiFi.h>
//////////////////////////////////////////////////////////////////
const int GasPin = A0; // ประกาศขา A0 ต่อกับ sensor MQ-2
const int GreenPin = D3; // ประกาศขา D3 ต่อกับ หลอด LED สีเขียว
const int RedPin = D4; // ประกาศขา D4 ต่อกับ หลอด LED สีเขียว
//////////////////////////////////////////////////////////////////
const int timedelay = 1000; //เวลาในการ delay สำหรับอุ่นหัวก่อนเริ่มโปรแกรม 1000 = 1 วินาที แนะนำที่ 30000 หรื 30 วินาที
@9arduino
9arduino / Tree new.ino
Last active April 23, 2025 13:57
โปรเจคเครื่องรดน้ำต้นไม้อัตโนมัติ ด้วย Arduino ราคาถูก พร้อม Code ตัวอย่าง https://www.ab.in.th/b/10
/*
โปรเจคเครื่องรดน้ำต้นไม้อัตโนมัติ ด้วย Arduino ราคาถูก พร้อม Code ตัวอย่าง
จากบทความ https://www.ab.in.th/b/10
แก้ไข 7/05/2562
*/
const int analogInPin = A0; // ขา analog สำหรับต่อ sensor
const int stPin = 11; // ขา 11 Pin แสดง Status
int sensorValue = 0;