Skip to content

Instantly share code, notes, and snippets.

@ThaiEasyElec
Last active July 23, 2019 10:36
Show Gist options
  • Save ThaiEasyElec/c561183cd450ebd4883456501c4b3ff1 to your computer and use it in GitHub Desktop.
Save ThaiEasyElec/c561183cd450ebd4883456501c4b3ff1 to your computer and use it in GitHub Desktop.
Home Alarm System
void setup()
{
Serial.begin(9600); // Define Serial for Debug Sensor & Keyped
lcd.begin(); //Define LCD
lcd.backlight();
pinMode(status_lock, OUTPUT); // Sets the digital pin as output
pinMode(status_unlock, OUTPUT); // Sets the digital pin as output
pinMode(led_bed, OUTPUT); // Sets the digital pin as output
pinMode(led_bath, OUTPUT); // Sets the digital pin as output
pinMode(Buzzer, OUTPUT); // Sets the digital pin as output
keypad.addEventListener(keypadEvent); // Add an event listener for this keypad
// Sets First Screen LCD
lcd.print("* Hello Welcome To *");
lcd.setCursor(0, 1);
lcd.print(" Home Alarm Systems ");
lcd.setCursor(0, 2);
lcd.print("www.ThaiEasyElec.com");
lcd.setCursor(0, 3);
lcd.print(" ** Home Lock ** ");
}
void loop()
{
keypad.getKey(); // Check the Keyped
motion_on(); // Open PIR Motion Sensor
flame_on(); // Open Flame Detector Sensor
close_all_power(); // Close Light1-2 and Set status_lock
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment