diff --git a/firmware/PIMORONI_BADGER2040W/lib/badger2040.py b/firmware/PIMORONI_BADGER2040W/lib/badger2040.py index 5765b0a..e077c1c 100644 --- a/firmware/PIMORONI_BADGER2040W/lib/badger2040.py +++ b/firmware/PIMORONI_BADGER2040W/lib/badger2040.py @@ -1,12 +1,7 @@ import machine import micropython from picographics import PicoGraphics, DISPLAY_INKY_PACK -import network -from network_manager import NetworkManager -import WIFI_CONFIG -import uasyncio import time -import gc import wakeup import pcf85063a @@ -234,12 +229,19 @@ def status_handler(self, mode, status, ip): self.update() def isconnected(self): + import network return network.WLAN(network.STA_IF).isconnected() def ip_address(self): + import network return network.WLAN(network.STA_IF).ifconfig()[0] def connect(self): + from network_manager import NetworkManager + import WIFI_CONFIG + import uasyncio + import gc + if WIFI_CONFIG.COUNTRY == "": raise RuntimeError("You must populate WIFI_CONFIG.py for networking.") self.display.set_update_speed(2)