Toggle Navigation
Hatchery
Eggs
KINK
__init__.py
Users
Badges
Login
Register
__init__.py
raw
Content
import display import buttons import sys import audio import mch22 import wifi import usocket as socket def on_home_btn(pressed): if pressed: mch22.exit_python() def connectToWifi(): if not wifi.status(): wifi.connect() display.drawFill(display.WHITE) display.drawText(10, 10, "Connecting to WiFi...", 0x000000, "Roboto_Regular18") display.flush() if not wifi.wait(): return 0 return 1 def reboot(pressed): if pressed: mch22.exit_python() buttons.attach(buttons.BTN_A,reboot) logo = "kink.png" url = "http://22323.live.streamtheworld.com/KINK.mp3" APP_PATH = "/".join(__file__.split("/")[:-1]) sys.path.append(APP_PATH) connectToWifi() display.drawPng(0, 0, "%s/%s" % (APP_PATH, logo)) display.flush() ch = audio.play(url, volume=80)