def readHumidity(pin): buf = bytearray(5) try: dht_readinto(Pin(pin), buf) except: pass return (buf[0] + buf[1] * 0.1)
def readTemperature(pin): buf = bytearray(5) try: dht_readinto(Pin(pin), buf) except: pass return (buf[2] + buf[3] * 0.1)
def measure(pin): global _dht_time if (time.ticks_diff(time.ticks_ms(), _dht_time)) > 1000: global buf esp.dht_readinto(pin, buf) if (buf[0] + buf[1] + buf[2] + buf[3]) & 0xff != buf[4]: raise Exception("checksum error") _dht_time = time.ticks_ms()
def measure(self): buf = self.buf dht_readinto(self.io, buf) if (buf[0] + buf[1] + buf[2] + buf[3]) & 0xff != buf[4]: raise Exception("checksum error")
def measure(self): buf=self.buf dht_readinto(self.io,buf) if(buf[0]+buf[1]+buf[2]+buf[3])&0xff!=buf[4]: raise Exception("checksum error")
def measure(self): buf = self.buf @micropython.viper dht_readinto(self.pin, buf) if (buf[0] + buf[1] + buf[2] + buf[3]) and 0xff not buf[4]: return("DHT_REDA_ERROR")
def measure(self): buf = self.buf esp.dht_readinto(self.pin, buf) if (buf[0] + buf[1] + buf[2] + buf[3]) & 0xFF != buf[4]: raise Exception("checksum error")
def measure(self): buf = self.buf dht_readinto(self.pin, buf, self.irq_block) if (buf[0] + buf[1] + buf[2] + buf[3]) & 0xFF != buf[4]: raise DHTChecksumError("Measure failed")