verander website naar self
This commit is contained in:
11
dht11.py
11
dht11.py
@@ -9,8 +9,6 @@ sensor = adafruit_dht.DHT11(board.D6)
|
|||||||
LED_PIN = 21
|
LED_PIN = 21
|
||||||
FAN_PIN = 22
|
FAN_PIN = 22
|
||||||
|
|
||||||
website = http.server.BaseHTTPRequestHandler
|
|
||||||
|
|
||||||
GPIO.setmode(GPIO.BCM)
|
GPIO.setmode(GPIO.BCM)
|
||||||
GPIO.setup(LED_PIN, GPIO.OUT)
|
GPIO.setup(LED_PIN, GPIO.OUT)
|
||||||
GPIO.setup(FAN_PIN, GPIO.OUT)
|
GPIO.setup(FAN_PIN, GPIO.OUT)
|
||||||
@@ -31,10 +29,11 @@ def check_data():
|
|||||||
GPIO.output(FAN_PIN, GPIO.LOW)
|
GPIO.output(FAN_PIN, GPIO.LOW)
|
||||||
|
|
||||||
class handler_class(http.server.BaseHTTPRequestHandler):
|
class handler_class(http.server.BaseHTTPRequestHandler):
|
||||||
if website.path == '/':
|
def do_WEB (self):
|
||||||
website.send_response(200)
|
if self.path == '/':
|
||||||
website.send_header('Content-type', 'text/html; charset=utf-8')
|
self.send_response(200)
|
||||||
website.wfile.write ("<html><head><title>gedoe</title></head><body><h1>hallo</h1><hr><p>hallo</p></body></html>")
|
self.send_header('Content-type', 'text/html; charset=utf-8')
|
||||||
|
self.wfile.write ("<html><head><title>gedoe</title></head><body><h1>hallo</h1><hr><p>hallo</p></body></html>")
|
||||||
|
|
||||||
|
|
||||||
def web_server():
|
def web_server():
|
||||||
|
|||||||
Reference in New Issue
Block a user