Skip to content

Instantly share code, notes, and snippets.

@9arduino
9arduino / DS3231.ino
Last active April 23, 2025 13:55
สอนใช้งาน DS3231 โมดูลนาฬิกา ตั้งเวลา ง่ายๆ https://www.ab.in.th/b/58
/*
สอนใช้งาน DS3231 โมดูลนาฬิกา ตั้งเวลา ง่ายๆ
บทความ https://www.ab.in.th/b/58
download : https://www.ab.in.th
*/
#include <Wire.h>
#include <SPI.h>
#include <RTClib.h>
@9arduino
9arduino / dht22.ino
Last active April 23, 2025 13:57
ตัวอย่าง การใช้งาน Sensor DHT22 https://www.ab.in.th/b/22
/*
ตัวอย่าง การใช้งาน Sensor DHT22 สินค้า
บทความ : https://www.ab.in.th/b/22
Download Library LCD I2C : https://download.เอบี.ไทย/d.php?file=Arduino-LiquidCrystal-I2C-library-master.zip
Download Library DHT22 : https://download.เอบี.ไทย/d.php?file=DHT-sensor-library-master.zip
*/
#include "DHT.h"
#define DHTPIN 2 // what digital pin we're connected to
@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;
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 วินาที
/*
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>
@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);
@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 / 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 / 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 / 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