Toggle Navigation
Hatchery
Eggs
social distormtion
__init__.py
Users
Badges
Login
Register
MCH2022 badge?
go to mch2022.badge.team
__init__.py
raw
Content
import urequests import uinterface import rgb import time sleep_time = 5 def main(): response_hash = 0 show_message("setting up", [255,255,255], 5) while True: while uinterface.connect_wifi() == False: print("wifi fail, reconnecting") try: print("fetching..") result = urequests.get("https://cccamp.fly.dev/api/msg").json() if hash(result["text"]) != response_hash: print("new message") print("hash result") print(response_hash) response_hash = hash(result["text"]) print("new cached val result") print(response_hash) show_message(result["text"], result["color"], result["bright"]) except BaseException as ex: print("error! ", ex) time.sleep(sleep_time) def show_message(text, color, bright): rgb.clear() rgb.setbrightness(bright) rgb.scrolltext(text, color) main()