Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021-010
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
0
Merge Requests
0
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
2021-010
2021-010
Commits
5925c870
Commit
5925c870
authored
Oct 17, 2021
by
Lakshan Wijewardana W.M.W-IT18132588
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update ino file
parent
e22b4df1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
Esp-32-wifi_module/test1/test1.ino
Esp-32-wifi_module/test1/test1.ino
+12
-2
No files found.
Esp-32-wifi_module/test1/test1.ino
View file @
5925c870
...
...
@@ -6,6 +6,7 @@
const
int
ledPin1
=
32
;
const
int
ledPin2
=
33
;
const
int
ledPin3
=
15
;
#define FIREBASE_HOST "https://esp32ndvi-default-rtdb.asia-southeast1.firebasedatabase.app/"
#define FIREBASE_AUTH "HKm15Lmcvp6NKLOwzioO3AXpa4lANrrpbalX7dl9"
...
...
@@ -33,6 +34,13 @@ void configureSensor(void)
void
loop
(){
if
(
WiFi
.
status
()
==
WL_CONNECTED
){
digitalWrite
(
ledPin3
,
HIGH
);
}
else
{
digitalWrite
(
ledPin3
,
LOW
);
}
digitalWrite
(
ledPin1
,
HIGH
);
digitalWrite
(
ledPin2
,
HIGH
);
...
...
@@ -58,7 +66,7 @@ delay(ms);
json
.
set
(
"/ndvi"
,
NDVI
);
json
.
set
(
"/nir"
,
nir
);
json
.
set
(
"/vis"
,
vis
);
Firebase
.
updateNode
(
firebaseData
,
"/Sensor"
,
json
);
Firebase
.
updateNode
(
firebaseData
,
"/Sensor
/dev1
"
,
json
);
}
...
...
@@ -67,6 +75,7 @@ void setup()
{
pinMode
(
ledPin1
,
OUTPUT
);
pinMode
(
ledPin2
,
OUTPUT
);
pinMode
(
ledPin3
,
OUTPUT
);
configureSensor
();
Serial
.
begin
(
9600
);
Wire
.
begin
();
...
...
@@ -80,6 +89,7 @@ void setup()
Serial
.
print
(
"."
);
}
// Print local IP address and start web server
Serial
.
println
(
""
);
Serial
.
println
(
"WiFi connected."
);
Serial
.
println
(
"IP address: "
);
...
...
@@ -94,4 +104,4 @@ void setup()
Serial
.
println
(
"------------------------------------"
);
Serial
.
println
(
"Connected..."
);
}
}
\ 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