Exemplo n.º 1
0
def get_humidity():
    sensor = DHT(DHTpin)
    status = sensor.readDHT11()
    if status is sensor.DHTLIB_OK:
        return sensor.humidity
    else:
        return None
Exemplo n.º 2
0
def get_temperature():
    sensor = DHT(DHTpin)
    status = sensor.readDHT11()
    if status is sensor.DHTLIB_OK:
        return sensor.temperature
    else:
        return None
Exemplo n.º 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)
Exemplo n.º 4
0
def get_temp():
    dht = DHT(11)
    dht.readDHT11
    return (dht.temperature)