-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCode
More file actions
36 lines (35 loc) · 719 Bytes
/
Code
File metadata and controls
36 lines (35 loc) · 719 Bytes
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
int LED1=7;
int GND1=13;
int LED2=8;
int GND2=9;
int pirOutput=6;
void setup()
{
Serial.begin(9600);
pinMode(LED1,OUTPUT);
pinMode(GND1,OUTPUT);
pinMode(LED2,OUTPUT);
pinMode(GND2,OUTPUT);
pinMode(pirOutput,INPUT);
digitalWrite(pirOutput,LOW);
digitalWrite(GND1,LOW);
digitalWrite(GND2,LOW);
digitalWrite(LED1,LOW);
digitalWrite(LED2,LOW);
delay(15000);
digitalWrite(LED1,HIGH);
}
void loop()
{
if(digitalRead(pirOutput)==HIGH)
{
digitalWrite(LED2,HIGH);
Serial.println("OK");
delay(1000);
Serial.println("ATD+91xxxxxxxxxx;");//add target mobile number in place of xxxxxxxxxx
delay(15000);
Serial.println("ATH");
digitalWrite(LED2,LOW);
delay(1000);
}
}