Commit 9a5b1050 authored by ryan.whiteley's avatar ryan.whiteley

lcd display fixed

parent b5c9eb21
...@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment