uPyLibs/init_sample.py

18 lines
625 B
Python

class init_sample:
def __init__(self, hw):
#Basic script to print module family, variant, and IP address
from network import WLAN as wlan, STA_IF as staif
from time import sleep_ms
if hw.features.display.oled:
oled = hw.oled.handle
oled.text("hey",0,0)
oled.text(hw.family,0,8)
oled.text(hw.variant,0,16)
oled.text(wlan(staif).ifconfig()[0],0,24)
oled.show()
else:
print(hw.family)
print(hw.variant)
print(wlan(staif).ifconfig()[0])
sleep_ms(1000)