Exemple #1
0
def get_humidity():
    sensor = DHT(DHTpin)
    status = sensor.readDHT11()
    if status is sensor.DHTLIB_OK:
        return sensor.humidity
    else:
        return None
Exemple #2
0
def get_temperature():
    sensor = DHT(DHTpin)
    status = sensor.readDHT11()
    if status is sensor.DHTLIB_OK:
        return sensor.temperature
    else:
        return None
Exemple #3
0
def get_temperature():
    global current_temperature
    try:
        sensor = DHT(DHTpin)
        status = sensor.readDHT11()
        if status is sensor.DHTLIB_OK:
            current_temperature = sensor.temperature
    except Exception as e:
        print(e)
Exemple #4
0
def get_temp():
    dht = DHT(11)
    dht.readDHT11
    return (dht.temperature)