i keep forgetting how class declarations work in python
This commit is contained in:
parent
ad1e7cc95f
commit
b19a681565
|
@ -1,16 +1,17 @@
|
|||
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("uPyConfig!",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)
|
||||
class PrintHWInfo:
|
||||
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("uPyConfig!",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)
|
||||
|
|
Loading…
Reference in New Issue