Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
IoT soil moisture project
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ryan.whiteley
IoT soil moisture project
Commits
9a5b1050
Commit
9a5b1050
authored
Dec 06, 2021
by
ryan.whiteley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lcd display fixed
parent
b5c9eb21
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
soil_moisture.py
soil_moisture.py
+9
-8
No files found.
soil_moisture.py
View file @
9a5b1050
...
@@ -66,22 +66,23 @@ def main_loop(channel):#insert channel variable when setting up thingspeak
...
@@ -66,22 +66,23 @@ def main_loop(channel):#insert channel variable when setting up thingspeak
print
(
'soil average:
%
d
%%
'
%
soil_avg
)
print
(
'soil average:
%
d
%%
'
%
soil_avg
)
print
(
'CPU temp @: '
,
cpu_ts
)
print
(
'CPU temp @: '
,
cpu_ts
)
#print to the LCD display
lcd
.
setCursor
(
0
,
0
)
lcd
.
message
(
'Soil avg:
%
d
%%
'
%
soil_avg
+
'
\n
'
)
lcd
.
message
(
'CPU Temp: '
+
cpu_ts
)
#publish sensor info to MQTT server
#publish sensor info to MQTT server
publish
.
single
(
mqtt_soil_path_one
,
soil_one_percent
,
hostname
=
mqtt_soil_server
)
publish
.
single
(
mqtt_soil_path_one
,
soil_one_percent
,
hostname
=
mqtt_soil_server
)
publish
.
single
(
mqtt_soil_path_two
,
soil_two_percent
,
hostname
=
mqtt_soil_server
)
publish
.
single
(
mqtt_soil_path_two
,
soil_two_percent
,
hostname
=
mqtt_soil_server
)
publish
.
single
(
mqtt_soil_path_avg
,
soil_avg
,
hostname
=
mqtt_soil_server
)
publish
.
single
(
mqtt_soil_path_avg
,
soil_avg
,
hostname
=
mqtt_soil_server
)
#send to thingspeak
#send to thingspeak
test
=
5
response
=
channel
.
update
({
'field1'
:
soil_one_percent
,
'field2'
:
soil_two_percent
,
'field3'
:
soil_avg
,
'field4'
:
cpu_ts
})
response
=
channel
.
update
({
'field1'
:
soil_one_percent
,
'field2'
:
soil_two_percent
,
'field3'
:
soil_avg
,
'field4'
:
cpu_ts
})
#print to the LCD display
except
ValueError
as
ve
:
#lcd.setCursor(0,0)
#lcd.message('Soil avg: ' + soil_avg)
#ldc.message('CPU Temp: ' + cpu_temp_finder())
except
:
print
(
'failed'
)
print
(
'failed'
)
print
(
ve
)
#LCD display code from freenove kit for lcd screen functionality
#LCD display code from freenove kit for lcd screen functionality
pcf_address
=
0x27
pcf_address
=
0x27
...
...
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