Skip to content

Instantly share code, notes, and snippets.

/*
PIR On-Off Lamp By BoardWell Electronics
*/
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2);
int ledPin = 2; // choose the pin for the LED
int inputPin = 7; // choose the input pin (for PIR sensor)
int pirState = LOW; // we start, assuming no motion detected
/*
* PIR On-Off Lamp By BoardWell Electronics
*/
int ledPin = 2; // choose the pin for the LED
int inputPin = 7; // choose the input pin (for PIR sensor)
int pirState = LOW; // we start, assuming no motion detected
int val = 0; // variable for reading the pin status
int delayvalue = 30000; // delay time
#define LED_Pin 2
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_Pin, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_Pin, HIGH); // turn the LED on (HIGH is the voltage level)
/*
* PIR sensor tester
*/
int ledPin = 13; // choose the pin for the LED
int inputPin = 2; // choose the input pin (for PIR sensor)
int pirState = LOW; // we start, assuming no motion detected
int val = 0; // variable for reading the pin status
int delayvalue = 30000; // delay time
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 16, 2); f
void setup()
{
lcd.begin();
//lcd.noBacklight(); // ปิด backlight
lcd.backlight(); // เปิด backlight
lcd.home();
/*
PIR sensor tester
*/
//int PIR_override = 3; // the number of the switch pin
int overridestatus = 13; // the number of the led pin
int relaypin = 5; // choose the pin for the LED
int inputPin = 2; // choose the input pin (for PIR sensor)
// I2C Scanner
// Written by Nick Gammon
// Date: 20th April 2011
#include <Wire.h>
void setup() {
Serial.begin (9600);
while (!Serial)
{
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include "DHT.h"
#include "EmonLib.h" // Include Emon Library
//----------------------Pin_Read_DHT22-----------//
#define DHT1PIN 5
#define DHT2PIN 2
#define DHT1TYPE DHT22
//*************************************************//
// Create By xzenzza //
// //
// Using for Study only //
#include "DHT.h"
#include <ESP8266WiFi.h>
#define DHTPIN D2 // เชื่อมต่อขา output ของDHT 22 เข้ายังขา D2 น่ะครับ
const char* ssid = "C&EST_RMUTI";
const char* password = "PASSWORD";