# 34 HelloWorld.py import netman import socket from machine import Pin, ADC ssid = 'xxxx' password = 'xxxx' country = 'US' wifi_connection = netman.connectWiFi(ssid,password,country) def web_page(Temp, V0, V1, B15, B14, N): f = open("34 Text.html","rt") x = f.read() x = x.replace('\r\n',' ') x = x.replace('aaaaa', str(Temp)) x = x.replace('bbbbb', str(V0)) x = x.replace('ccccc', str(V1)) x = x.replace('ddddd', str(B15)) x = x.replace('eeeee', str(B14)) x = x.replace('fffff', str(N)) return(x) # Open socket addr = socket.getaddrinfo('0.0.0.0', 80)[0][-1] wlan = socket.socket() wlan.bind(addr) wlan.listen(1) print('listening on', addr) a2d0 = ADC(0) a2d1 = ADC(1) a2d4 = ADC(4) k = 3.3 / 65520 B15 = Pin(15, Pin.IN) B14 = Pin(14, Pin.IN) N = 0 while(1): cl, addr = wlan.accept() print('client connected from', addr) request = cl.recv(1024) N += 1 V0 = a2d0.read_u16()*k V1 = a2d1.read_u16()*k a4 = a2d4.read_u16() Temp = 0.02927*(14940 - a4) response = web_page(Temp, V0, V1, B15.value(), B14.value(), N) cl.send(response) cl.close()