Code:
from w1thermsensor import W1ThermSensorimport timewhile True: localtime = time.asctime( time.localtime(time.time())) print(localtime) for sensor in W1ThermSensor.get_available_sensors(): print(f"Sensor {sensor.id} has temperature {sensor.get_temperature()}C") print('\n') time.sleep(1800)
However, I would like to be able to plot the results and have more control over the output, which sometimes prints out with multiple Decimal places.
Is anyone able to advise me how to copy the output to a normal variable so that I can then store the results in an array. I currently have 2 sensors but in the future I want to be able to add more sensors, so the code needs to be able to cope with as many sensors as are connected.
Thank you
Statistics: Posted by RDS — Sat Mar 30, 2024 5:58 pm