Skip to content

Instantly share code, notes, and snippets.

@tenergyinnovation
Created March 25, 2019 16:06
Show Gist options
  • Save tenergyinnovation/d5e5637fa8c0d36915d0a4a80d7f0793 to your computer and use it in GitHub Desktop.
Save tenergyinnovation/d5e5637fa8c0d36915d0a4a80d7f0793 to your computer and use it in GitHub Desktop.
Arduino UNO PIR
/***********************************************************************
* 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