Toggle Navigation
Hatchery
Eggs
event_feed_no
__init__.py
Users
Badges
Login
Register
MCH2022 badge?
go to mch2022.badge.team
__init__.py
raw
Content
import urequests import time import badge import appglue import ugfx import wifi wifi.init() while not wifi.sta_if.isconnected(): time.sleep(0.1) png = '/lib/event_feed_no/stream_no.png' url = 'https://dedi.vdwaa.nl/~jelle/feed_s5.png' # Return home ugfx.input_attach(ugfx.BTN_B, lambda pushed: appglue.home() if pushed else 0) while True: r = urequests.get(url, stream=True) try: badge.eink_png(0,0, r.content) except TypeError: with open(png, 'wb') as out_file: out_file.write(r.content) badge.eink_png(0,0, png) ugfx.flush() time.sleep(2) del r