Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2022-018
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2022-018
2022-018
Commits
30966d30
Commit
30966d30
authored
Oct 08, 2022
by
Peellapitiya D I IT19111902
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload New File
parent
f718787b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
99 additions
and
0 deletions
+99
-0
code_for_demo.ino
code_for_demo.ino
+99
-0
No files found.
code_for_demo.ino
0 → 100644
View file @
30966d30
#include <dht.h>
dht
PIR
;
void
setup
()
{
// put your setup code here, to run once:
Serial
.
begin
(
9600
);
pinMode
(
2
,
INPUT
);
pinMode
(
9
,
OUTPUT
);
//pinMode(3,INPUT);
//pinMode(10,OUTPUT);
pinMode
(
4
,
INPUT
);
pinMode
(
11
,
OUTPUT
);
pinMode
(
5
,
INPUT
);
pinMode
(
12
,
OUTPUT
);
pinMode
(
6
,
INPUT
);
pinMode
(
13
,
OUTPUT
);
pinMode
(
8
,
OUTPUT
);
pinMode
(
10
,
OUTPUT
);
}
void
loop
()
{
// put your main code here, to run repeatedly:
//dht 11 sensor val
int
val
=
PIR
.
read11
(
7
);
int
val2
=
digitalRead
(
2
);
//int val3 = digitalRead(3);
int
val4
=
digitalRead
(
4
);
int
val5
=
digitalRead
(
5
);
int
val6
=
digitalRead
(
6
);
if
(
val2
==
1
){
digitalWrite
(
9
,
HIGH
);
}
else
{
digitalWrite
(
9
,
LOW
);
}
/*if(val3 == 1){
digitalWrite(10,HIGH);
}
else{
digitalWrite(10,LOW);
}*/
if
(
val4
==
1
){
digitalWrite
(
11
,
HIGH
);
}
else
{
digitalWrite
(
11
,
LOW
);
}
if
(
val5
==
1
){
digitalWrite
(
12
,
HIGH
);
}
else
{
digitalWrite
(
12
,
LOW
);
}
if
(
val6
==
1
){
digitalWrite
(
13
,
HIGH
);
}
else
{
digitalWrite
(
13
,
LOW
);
}
//for humidity controller and temprature capture
int
temp
=
PIR
.
temperature
;
int
humid
=
PIR
.
humidity
;
if
(
humid
<
77
){
//to in6 relay
digitalWrite
(
8
,
HIGH
);
//to in7 relay
digitalWrite
(
10
,
LOW
);
}
else
{
//to in6 relay
digitalWrite
(
8
,
LOW
);
//to in7 relay
digitalWrite
(
10
,
HIGH
);
}
Serial
.
print
(
"Temperature = "
);
Serial
.
print
(
PIR
.
temperature
);
Serial
.
print
(
"
\t
Humidity = "
);
Serial
.
println
(
PIR
.
humidity
);
delay
(
2000
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment