Created
March 25, 2019 16:06
-
-
Save tenergyinnovation/d5e5637fa8c0d36915d0a4a80d7f0793 to your computer and use it in GitHub Desktop.
Arduino UNO 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_UNO_PIR | |
* Description : Motion Sensor Test | |
* 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 7 | |
/*********************************************************************** | |
* FUNCTION: setup | |
* DESCRIPTION: setup process | |
* PARAMETERS: nothing | |
* RETURNED: nothing | |
***********************************************************************/ | |
void setup(){ | |
pinMode(inputPin, INPUT); | |
Serial.begin(9600); | |
Serial.println("************************************************"); | |
Serial.println("Project : Arduino_UNO_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