-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSIM800L.ino
58 lines (52 loc) · 1.61 KB
/
SIM800L.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
52
53
54
55
56
57
58
void Warning() {
int state = 0;
(analogRead(A0) >= 500) ? (state = 1) : (state = 0);
if (state == 1) {
digitalWrite(LED_G, LOW);
digitalWrite(LED_R, HIGH);
Serial.println("ATD+ +91your phone number;");
delay(15000); // wait for 15 seconds...
Serial.println("ATH"); //hang up
delay(2000);
/*
// Set SMS text mode
Serial.println("AT+CMGF=1");
delay(500);
<<<<<<< HEAD
// Set recipient phone number and message
Serial.println("AT+CMGS=\"+919406867350\"\r");
delay(500);
=======
// Set SMS text mode
Serial.println("AT+CMGF=1");
delay(500);
// Set recipient phone number and message
Serial.println("AT+CMGS=\"+91your phone number\"\r");
delay(500);
// Send the message text
Serial.println("Suspecious Activity found at the security system, please take action");
delay(500);
// Send Ctrl+Z to indicate end of message
Serial.println((char)26); // ASCII code for Ctrl+Z
>>>>>>> 61c7319932d3276fcb664d36455d1c92c4be0452
// Send the message text
Serial.println("Suspecious Activity found at the security system, please take action");
delay(500);
// Send Ctrl+Z to indicate end of message
Serial.println((char)26); // ASCII code for Ctrl+Z
*/
while (true) {
digitalWrite(BUZZER, HIGH);
digitalWrite(LED_R, HIGH);
delay(200);
digitalWrite(BUZZER, LOW);
digitalWrite(LED_R, LOW);
delay(200);
digitalWrite(BUZZER, HIGH);
digitalWrite(LED_R, HIGH);
delay(200);
digitalWrite(BUZZER, LOW);
digitalWrite(LED_R, LOW);
}
}
}