# Import the microdot web server library from microdot import Microdot, Response from dht import DHT11 from machine import Pin # We also need network access so clients can connect to our web page... import network # Make sure we're connected to the network wlan = network.WLAN(network.STA_IF) if not wlan.isconnected(): print("Network isn't connected!") # If we're not connected, quit. # A better solution might be to try connecting to WiFi instead of giving up from sys import exit exit() # Print out our IP address so we know where to point the web browser! ip_address = wlan.ifconfig()[0] print("Site will be accessible at http://{}".format(ip_address)) sensor = DHT11(Pin(23)) # Set up the microdot server app = Microdot() page = """