-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathArduino-Home-Security-project.ino
51 lines (45 loc) · 1.09 KB
/
Arduino-Home-Security-project.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include "StateFunctions.h"
#include "IdleState.h"
#include "InputState.h"
#include "UnlockState.h"
#include "AlertState.h"
#include "AdminState.h"
int Next_Program_State;
void setup()
{
// Initialise arduino pin modes
pinMode(PIR_Pin, INPUT);
pinMode(BUZZER_Pin, OUTPUT);
pinMode(LOCK_Pin, OUTPUT);
lcd.begin(16, 2); // Initialise LCD rows & columns
lcd.print("Bismillah"); // بنسمي الله
SPI.begin(); // Initialise SPI bus
RFID.PCD_Init(); // Initialise MFRC522
// Initialise the Programs state
Next_Program_State = TO_ADMIN_STATE;
motion_detected = false;
lockSolenoid();
}
void loop()
{
if ((validRFID()))
lcd.print("Nice");
// switch(Next_Program_State)
// {
// case TO_IDLE_STATE:
// Next_Program_State = From_IdleState();
// break;
// case TO_INPUT_STATE:
// Next_Program_State = From_InputState();
// break;
// case TO_UNLOCK_STATE:
// Next_Program_State = From_UnlockState();
// break;
// case TO_ALERT_STATE:
// Next_Program_State = From_AlertState();
// break;
// case TO_ADMIN_STATE:
// Next_Program_State = From_AdminState();
// break;
// }
}