Last active
September 24, 2022 20:32
-
-
Save PaulskPt/b0d3e075f654658fc47c3a8f6c83aaa4 to your computer and use it in GitHub Desktop.
UM_FeatherS2_with_CircuitPython_V7.3.3._WiFi_test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time, gc, os | |
import board | |
import feathers3 | |
import wifi | |
import socketpool | |
try: | |
from secrets import secrets | |
except ImportError: | |
print("WiFi secrets are kept in secrets.py, please add them there!") | |
raise | |
print() | |
try: | |
wifi.AuthMode.WPA2 | |
wifi.radio.connect(secrets["ssid"], secrets["password"]) | |
ip = wifi.radio.ipv4_address | |
if ip: | |
print("Connected to %s!"%secrets["ssid"]) | |
print("My IP address is", ip) | |
except ConnectionError as e: | |
print("Wifi", e) | |
pass | |
time.sleep(5) | |
# Say hello | |
print("\nHello from FeatherS3!") | |
print("------------------\n") | |
# Show available memory | |
print("Memory Info - gc.mem_free()") | |
print("---------------------------") | |
print("{} Bytes\n".format(gc.mem_free())) | |
flash = os.statvfs('/') | |
flash_size = flash[0] * flash[2] | |
flash_free = flash[0] * flash[3] | |
# Show flash size | |
print("Flash - os.statvfs('/')") | |
print("---------------------------") | |
print("Size: {} Bytes\nFree: {} Bytes\n".format(flash_size, flash_free)) | |
# Rainbow colours on the NeoPixel | |
print("Entering loop") | |
loop_nr = 0 | |
while True: | |
#time.sleep(3) | |
loop_nr += 1 | |
if loop_nr > 0 and loop_nr % 100 == 0: | |
print("loop nr: ",loop_nr) | |
if loop_nr >= 10000: | |
loop_nr = 0 | |
time.sleep(2) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
REPL output: