Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
ifarm
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
TMP-2022-009
ifarm
Commits
c79d0ee2
Commit
c79d0ee2
authored
Nov 16, 2022
by
ayodyabanuka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated Arduino code
parent
da66105c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
lib/AB/Arduino Project/Project.ino
lib/AB/Arduino Project/Project.ino
+13
-9
No files found.
lib/AB/Arduino Project/Project.ino
View file @
c79d0ee2
...
@@ -95,6 +95,17 @@ void loop() {
...
@@ -95,6 +95,17 @@ void loop() {
}
}
else
if
(
e
==
2
)
{
else
if
(
e
==
2
)
{
digitalWrite
(
LED1
,
LOW
);
digitalWrite
(
LED1
,
LOW
);
Firebase
.
getInt
(
firebaseDataServo
,
"/Food/"
+
productnumber
+
"/SERVO"
);
s
=
firebaseDataServo
.
intData
();
Serial
.
print
(
" Servo: "
);
Serial
.
println
(
s
);
if
(
s
==
0
)
{
servo
.
write
(
0
);
// tell servo to go to position in variable 'pos'
}
else
{
servo
.
write
(
180
);
}
}
}
foodMoistureValue
=
analogRead
(
A0
);
foodMoistureValue
=
analogRead
(
A0
);
...
@@ -112,19 +123,12 @@ void loop() {
...
@@ -112,19 +123,12 @@ void loop() {
Firebase
.
setInt
(
firebaseDataMoist
,
"/Food/"
+
productnumber
+
"/ERROR"
,
2
);
Firebase
.
setInt
(
firebaseDataMoist
,
"/Food/"
+
productnumber
+
"/ERROR"
,
2
);
}
else
{
}
else
{
Firebase
.
setInt
(
firebaseDataMoist
,
"/Food/"
+
productnumber
+
"/ERROR"
,
1
);
Firebase
.
setInt
(
firebaseDataMoist
,
"/Food/"
+
productnumber
+
"/ERROR"
,
1
);
}
}
Firebase
.
setFloat
(
firebaseDataMoist
,
"/Food/"
+
productnumber
+
"/Moist/foodMoist"
,
foodpercent
);
Firebase
.
setFloat
(
firebaseDataMoist
,
"/Food/"
+
productnumber
+
"/Moist/foodMoist"
,
foodpercent
);
Firebase
.
getInt
(
firebaseDataServo
,
"/Food/"
+
productnumber
+
"/SERVO"
);
s
=
firebaseDataServo
.
intData
();
Serial
.
print
(
" Servo: "
);
Serial
.
println
(
s
);
if
(
s
==
0
)
{
servo
.
write
(
0
);
// tell servo to go to position in variable 'pos'
}
else
{
servo
.
write
(
180
);
}
delay
(
1000
);
delay
(
1000
);
}
}
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