zet fan en LED aan wanneer temp hoger dan 20
This commit is contained in:
6
dht11.py
6
dht11.py
@@ -18,4 +18,10 @@ while True:
|
|||||||
humidity = sensor.humidity
|
humidity = sensor.humidity
|
||||||
except RuntimeError as err:
|
except RuntimeError as err:
|
||||||
print(err.args[0])
|
print(err.args[0])
|
||||||
|
if temperatuur_C > 20:
|
||||||
|
GPIO.output(LED_PIN, GPIO.HIGH)
|
||||||
|
GPIO.output(FAN_PIN, GPIO.HIGH)
|
||||||
|
else:
|
||||||
|
GPIO.output(LED_PIN, GPIO.LOW)
|
||||||
|
GPIO.output(FAN_PIN, GPIO.LOW)
|
||||||
time.sleep(2.0)
|
time.sleep(2.0)
|
||||||
Reference in New Issue
Block a user