Add firmware Version to display
This commit is contained in:
parent
222aa46123
commit
f7a2a8a261
2 changed files with 12 additions and 2 deletions
|
@ -198,3 +198,11 @@ class Spi(object):
|
|||
while SPI_HEALTH:
|
||||
Spi.health_check()
|
||||
time.sleep(0.5)
|
||||
|
||||
@staticmethod
|
||||
def get_version():
|
||||
major = Spi.read(Register.IDENTIFICATION_MODEL_REV_MAJOR, 1)
|
||||
minor = Spi.read(Register.IDENTIFICATION_MODEL_REV_MINOR, 1)
|
||||
patch = Spi.read(Register.IDENTIFICATION_MODEL_REV_PATCH, 1)
|
||||
|
||||
return f"{major}.{minor}.{patch}"
|
||||
|
|
|
@ -60,8 +60,10 @@ def write_ip_to_screen():
|
|||
try:
|
||||
ip = str(get_ip())
|
||||
print(f"writing {ip} to display")
|
||||
Display.write(2, ip)
|
||||
Display.write(1, datetime.datetime.now().strftime("%b %d %H:%M:%S"))
|
||||
Display.write(1, f"FW. V{Spi.get_version()}")
|
||||
Display.write(2, datetime.datetime.now().strftime("%b %d %H:%M:%S"))
|
||||
Display.write(3, "IP:")
|
||||
Display.write(4, ip)
|
||||
time.sleep(5)
|
||||
except Exception as e:
|
||||
print(f"Exception in write ip thread: {e}")
|
||||
|
|
Reference in a new issue