Last active
March 22, 2019 14:02
-
-
Save sweemeng/cebdff54d09df2d3432b469b9ac42ff0 to your computer and use it in GitHub Desktop.
just a test for networking
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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