All hookups seem fine and when working on my project I started with the temp/humidity first and they worked fine. I then started working on a new app with just the relays. I followed this for each piece of my application and each seemed fine.
Now when putting it all tighter with Tk for the GUI on an LCD I'm running into all sorts of issues.
If I have a while True: my GUI locks ups and becomes slow to respond.
What I'd like to do is update the GUI with temperature, humidity and pressure with data from the sensors. And based on that information I can click a button to ask a relay to do something.
Again, if the while True: is in place to read the sensors and update the GUI its slow to respond to clicks on buttons. If I turn off the while True the GUI responds with no issues but I can't get a readout from my sensors.
I'm somewhat new to the Pi and have limited experience with Python so perhaps I'm doing something wrong in my while True: loop?
Code: Select all
while True:
displayTemmp['text'] = getTempData()
displayHumid['text'] = getHumidData()
displayPressure['text'] = getPressureData()
displayWeight['text'] = getWeight()
win.update_idletasks()
win.update()
time.sleep(3)
Thanks for any advice or help.