Created
July 23, 2019 10:33
-
-
Save ThaiEasyElec/5d219364a24ff6db2f1bf0743dc722b7 to your computer and use it in GitHub Desktop.
Home Alarm System
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
void motion_on() { // Function Open PIR Motion Sensor. | |
alarmValue = digitalRead(pir); // Read analog sensor 0 or 1. | |
//Serial.println (alarmValue); // Debug Sensor value. | |
if (alarmValue == 0) // Check the value | |
{ | |
Alarm(); | |
} | |
else | |
{ | |
Alarm_off(); | |
} | |
} | |
void flame_on(){ // Function Open Flame Detector Sensor. | |
alarmValue = analogRead(flame); // Read analog sensor 0-1023. | |
//Serial.println (alarmValue); // Debug Sensor value. | |
if(alarmValue <= 700){ // Check the value | |
Alarm(); | |
} | |
if(alarmValue > 700){ | |
Alarm_off(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment