Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2022-027
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-027
2022-027
Commits
8ae59b28
Commit
8ae59b28
authored
Nov 13, 2022
by
Wijesundara W.M.S.G
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new file
parent
81e52a54
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
0 deletions
+66
-0
Identify people who may be considered infected with high body temperature./Environment Temperature Detection.c
...igh body temperature./Environment Temperature Detection.c
+66
-0
No files found.
Identify people who may be considered infected with high body temperature./Environment Temperature Detection.c
0 → 100644
View file @
8ae59b28
#include <WiFi.h>
#include <FirebaseESP32.h>
#include "DHTesp.h"
#include<stdlib.h>
#define DHTpin 15
DHTesp
dht
;
char
buff
[
10
];
#define FIREBASE_HOST "https://esp32andfirebase.firebaseio.com/"
#define FIREBASE_AUTH "gga1JXWY5rgyBHk56RSXLn3FPpajWfcq6itIM3nI"
#define WIFI_SSID "SLT Mobitel 4G"
#define WIFI_PASSWORD "******"
FirebaseData
firebaseData
;
FirebaseJson
json
;
String
mytemp
;
String
myhum
;
void
setup
()
{
Serial
.
begin
(
115200
);
dht
.
setup
(
DHTpin
,
DHTesp
::
DHT11
);
WiFi
.
begin
(
WIFI_SSID
,
WIFI_PASSWORD
);
Serial
.
print
(
"Connecting to Wi-Fi"
);
while
(
WiFi
.
status
()
!=
WL_CONNECTED
)
{
Serial
.
print
(
"."
);
delay
(
300
);
}
Serial
.
println
();
Serial
.
print
(
"Connected with IP: "
);
Serial
.
println
(
WiFi
.
localIP
());
Serial
.
println
();
Firebase
.
begin
(
FIREBASE_HOST
,
FIREBASE_AUTH
);
Firebase
.
reconnectWiFi
(
true
);
Firebase
.
setReadTimeout
(
firebaseData
,
1000
*
60
);
Firebase
.
setwriteSizeLimit
(
firebaseData
,
"tiny"
);
//String path = "/data";
Serial
.
println
(
"------------------------------------"
);
Serial
.
println
(
"Connected..."
);
}
void
loop
()
{
delay
(
dht
.
getMinimumSamplingPeriod
());
float
humidity
=
dht
.
getHumidity
();
float
temperature
=
dht
.
getTemperature
();
myhum
=
dtostrf
(
humidity
,
3
,
2
,
buff
);
mytemp
=
dtostrf
(
temperature
,
3
,
2
,
buff
);
Serial
.
println
(
myhum
);
Serial
.
println
(
mytemp
);
delay
(
100
);
json
.
set
(
"/hum"
,
myhum
);
json
.
set
(
"/temp"
,
mytemp
);
Firebase
.
updateNode
(
firebaseData
,
"/Sensor"
,
json
);
}
\ No newline at end of file
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