diff --git a/CARDPUTER CircuitPython/wifi_switcher/code.py b/CARDPUTER CircuitPython/wifi_switcher/code.py index 8087692..9d14749 100644 --- a/CARDPUTER CircuitPython/wifi_switcher/code.py +++ b/CARDPUTER CircuitPython/wifi_switcher/code.py @@ -3,8 +3,6 @@ import time, os, rtc, json, wifi, supervisor # type: ignore import board, busio, sdcardio, storage, terminalio, displayio # type: ignore from adafruit_display_text import label # type: ignore from adafruit_display_shapes.rect import Rect # type: ignore -#import pytumblr # type: ignore -import tumblrapi # type: ignore ### DEFAULT HOME PAGE # # # # # # # # # # def home(): @@ -79,8 +77,6 @@ while True: WIFI_PASS = wifi_options[pos][1] break - -# SET UP WIFI try: wifi.radio.connect(ssid=WIFI_SSID, password=WIFI_PASS) @@ -89,15 +85,26 @@ try: for lab in menu_labs: display.root_group.remove(lab) except ConnectionError as e: + h1.text = "Aw..." + + for lab in menu_labs: + display.root_group.remove(lab) + txt = label.Label(terminalio.FONT, text = "", color=0xff0000, scale=1) txt.text = "Could not connect to " + WIFI_SSID txt.x = 10 - txt.y = 100 - display.root_group.append(txt) - time.sleep(10) - supervisor.reload() + txt.y = 35 -# # # # # # # # # # # # # # # # # # + txt2 = label.Label(terminalio.FONT, text = "", color=0x89a0a8, scale=1) + txt2.text = "Press CTRL + C followed by CTRL + D\nto soft-reboot" + txt2.x = 10 + txt2.y = 100 + + display.root_group.append(txt) + display.root_group.append(txt2) + + while True: + pass # SET UP SD CARD