Skip to content

Commit e6e8a96

Browse files
brentrubrentru
authored andcommitted
remove extra print, inc. sensor delay.
1 parent c8aa84c commit e6e8a96

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

PyPortal_AWS_IOT_Planter/code.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import aws_gfx_helper
2222

2323
# Time between polling the STEMMA, in minutes
24-
SENSOR_DELAY = 15
24+
SENSOR_DELAY = 0.2
2525

2626
# Get wifi details and more from a secrets.py file
2727
try:
@@ -143,13 +143,12 @@ def message(client, topic, msg):
143143
try:
144144
gfx.show_aws_status('Listening for msgs...')
145145
now = time.monotonic()
146-
if now - initial > (0.5 * 60):
146+
if now - initial > (SENSOR_DELAY * 60):
147147
# read moisture level
148148
moisture = ss.moisture_read()
149149
print("Moisture Level: ", moisture)
150150
# read temperature
151151
temperature = ss.get_temp()
152-
print("Temperature:{}F".format(temperature))
153152
# Display Soil Sensor values on pyportal
154153
temperature = gfx.show_temp(temperature)
155154
gfx.show_water_level(moisture)
@@ -169,4 +168,3 @@ def message(client, topic, msg):
169168
except (ValueError, RuntimeError) as e:
170169
print("Failed to get data, retrying", e)
171170
wifi.reset()
172-

0 commit comments

Comments
 (0)