Oct-20-2020, 06:38 AM
Hello,
I am trying to make a Gui with 2 labels that shows the live measurements of the sensors(DS18B20) that I have attached to a raspberry. The problem is that it wont't update the values it just shows the first values it has measured.
I hope someone can help me,
thanks in advance
this is the code that I am using.
I am trying to make a Gui with 2 labels that shows the live measurements of the sensors(DS18B20) that I have attached to a raspberry. The problem is that it wont't update the values it just shows the first values it has measured.
I hope someone can help me,
thanks in advance
this is the code that I am using.
root = tk.Tk() canvas = tk.Canvas(root, width=600, height=420, background="Black") canvas.pack() canvas.create_image(400, 240) sensor1, sensor2 = W1ThermSensor.get_available_sensors() temperatuur = sensor1.get_temperature() temperatuur2 = sensor2.get_temperature() Label3 = Label(text=temperatuur) Label3_window = canvas.create_window(100, 100, anchor="nw", window=Label3) Label4 = Label(text=temperatuur2) Label4_window = canvas.create_window(200, 200, anchor="nw", window=Label4) root.mainloop()