Skip to content

Instantly share code, notes, and snippets.

@sweemeng
Last active March 22, 2019 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sweemeng/cebdff54d09df2d3432b469b9ac42ff0 to your computer and use it in GitHub Desktop.
Save sweemeng/cebdff54d09df2d3432b469b9ac42ff0 to your computer and use it in GitHub Desktop.
just a test for networking
from m5stack import *
from m5ui import *
import urequests
import network
lcd.clear()
wlan = network.WLAN(network.STA_IF)
wlan.active(True)
wlan.connect("blergh", "blergh")
while not wlan.isconnected():
lcd.print("connecting", 20, 20)
lcd.clear()
if wlan.isconnected():
lcd.print("connected", 20, 20)
r = urequests.get("https://httpbin.org/get?key=nuiandsaindoaidnoin21onidsandosaindasoind")
lcd.print(r.status_code, 20, 35)
lcd.print(r.text, 20, 40)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment