Last active
March 26, 2019 03:10
-
-
Save tenergyinnovation/e4d6f2b2f3621664ab62bc659bf09a43 to your computer and use it in GitHub Desktop.
Arduino ESP32 PIR
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
/*********************************************************************** | |
* Project : Arduino_ESP32_PIR | |
* Description : LDR Testing | |
* Author : Tenergy Innovation Co., Ltd. | |
* Date : 14 Nov 2018 | |
* Revision : 1.0 | |
* Rev1.0 : Original | |
* Facebook : https://www.facebook.com/tenergy.innovation | |
* Email : tenergy.innovation@gmail.com | |
* TEL : +6689-140-7205 | |
***********************************************************************/ | |
/**************************************/ | |
/* GPIO Define */ | |
/**************************************/ | |
#define inputPin 14 | |
/*********************************************************************** | |
* FUNCTION: setup | |
* DESCRIPTION: setup process | |
* PARAMETERS: nothing | |
* RETURNED: nothing | |
***********************************************************************/ | |
void setup(){ | |
pinMode(inputPin,INPUT_PULLUP); | |
Serial.begin(9600); | |
Serial.println("************************************************"); | |
Serial.println("Project : Arduino_ESP32_PIR"); | |
Serial.println("Author : Tenergy Innovation Co., Ltd."); | |
Serial.println("Date : 14 Nov 2018"); | |
Serial.println("Facebook : https://www.facebook.com/tenergy.innovation"); | |
Serial.println("Email : tenergy.innovation@gmail.com"); | |
Serial.println("TEL : +6689-140-7205"); | |
Serial.println("************************************************"); | |
} | |
/*********************************************************************** | |
* FUNCTION: loop | |
* DESCRIPTION: loop process | |
* PARAMETERS: nothing | |
* RETURNED: nothing | |
***********************************************************************/ | |
void loop(){ | |
int value= digitalRead(inputPin); | |
if (value == HIGH) | |
{ | |
Serial.println("HIGH"); | |
} | |
else | |
{ | |
Serial.println("LOW"); | |
} | |
delay(300); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment