Toggle Navigation
Hatchery
Eggs
Tetris-CZ19-Multiplayer
badgehelper.py
Users
Badges
Login
Register
MCH2022 badge?
go to mch2022.badge.team
badgehelper.py
raw
Content
import time INIT = False RUNNING_ON_BADGE = False def on_badge(): global INIT, RUNNING_ON_BADGE """Check if code is running on a Badge""" if not INIT: try: import wifi RUNNING_ON_BADGE = True INIT = True except: RUNNING_ON_BADGE = False INIT = True return RUNNING_ON_BADGE # Add missing functionality on PC's python if (not "ticks_ms" in dir(time)): try: time.ticks_ms = lambda: int(round(time.time() * 1000)) pass except: pass