This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <LiquidCrystal_I2C.h> | |
LiquidCrystal_I2C lcd(0x27, 16, 2); f | |
void setup() | |
{ | |
lcd.begin(); | |
//lcd.noBacklight(); // ปิด backlight | |
lcd.backlight(); // เปิด backlight | |
lcd.home(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// I2C Scanner | |
// Written by Nick Gammon | |
// Date: 20th April 2011 | |
#include <Wire.h> | |
void setup() { | |
Serial.begin (9600); | |
while (!Serial) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir ./Documents/Arduino/hardware/espressif -p && cd ./Documents/Arduino/hardware/espressif && git clone https://github.com/espressif/arduino-esp32.git esp32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//*************************************************// | |
// 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"; |
NewerOlder