From 6f2b4fc6ceaf83cef21a0c0dbdbe36d579633e93 Mon Sep 17 00:00:00 2001 From: florisdebeast Date: Sun, 29 Jun 2025 01:33:31 +0200 Subject: [PATCH] voeg webserver toe --- dht11.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dht11.py b/dht11.py index 7b3941b..dc0ec85 100644 --- a/dht11.py +++ b/dht11.py @@ -2,6 +2,7 @@ import time import adafruit_dht import board import RPi.GPIO as GPIO +import http.server sensor = adafruit_dht.DHT11(board.D6) LED_PIN = 21 @@ -24,4 +25,7 @@ while True: else: GPIO.output(LED_PIN, GPIO.LOW) GPIO.output(FAN_PIN, GPIO.LOW) - time.sleep(2.0) \ No newline at end of file + web_binding = ('', 8000) + server = http.server.HTTPServer(web_binding) + print ("server draait") + server.serve_forever()