Post

Visualizzazione dei post da aprile, 2023

w600-pico costycnc first test web server led

Immagine
 In this video tutorial will show you how command a led with w600-pico conected as access point ... so directly to your computer or phone wifi ... without need to be conected through modem wifi ! If buy for me the module from https://www.costycnc.com/store/product/w600-pico-costycnc If want to write self the program ... the program: # setup the webserver try:     import usocket as socket except:     import socket      led = Pin(Pin.PA_00, Pin.OUT, Pin.PULL_FLOATING)     s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # create new socket, address family type = AF_INET, socket type = SOCK_STREAM s.bind(('', 80)) s.listen(5) # accept connections. backlog = 5 = max. number of unaccepted connections before refusing new connections while True:     conn, addr = s.accept()      request = conn.recv(200)     print(request)     if "/ledon" in request:         led.value(0)      if "/ledoff" in request:         led.value(1)      conn.send("HTTP/1.1 200 ok\n&qu