This is obviously untested, but perhaps you could modify the library code to return BOTH temperature and humidity in a single step, so that you halve the number of times you have to access the sensor by calling the DHT11.measure() method. That would remove the need to wait between getting readings of the two quantities.
Something like -Then in the outer 'application' code perhaps you would call that as -
Something like -
Code:
@property def temp_and_hum(self): self.measure() return self._temperature, self._humidityCode:
t, h = sensor.temp_and_hum()Statistics: Posted by B.Goode — Wed Jan 31, 2024 1:57 pm