Skip to content

Commit

Permalink
info.py: added badger os version number
Browse files Browse the repository at this point in the history
  • Loading branch information
thirdr committed Sep 11, 2024
1 parent 88d716d commit 7ec4fe6
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions badger_os/examples/info.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
import badger2040
from badger2040 import WIDTH
import version

TEXT_SIZE = 1
LINE_HEIGHT = 15

version = version.BUILD.split('-')
for word in version:
if word.startswith("v"):
version = word
break

display = badger2040.Badger2040()
display.led(128)

Expand All @@ -30,16 +37,17 @@
y += LINE_HEIGHT
display.text("296x128 pixel Black/White e-Ink", 5, y, WIDTH, TEXT_SIZE)
y += LINE_HEIGHT
y += LINE_HEIGHT

display.text("For more info:", 5, y, WIDTH, TEXT_SIZE)
y += LINE_HEIGHT
display.text("https://pimoroni.com/badger2040", 5, y, WIDTH, TEXT_SIZE)
y += LINE_HEIGHT
display.text("Badger OS " + version, 5, y, WIDTH, TEXT_SIZE)

display.update()

# Call halt in a loop, on battery this switches off power.
# On USB, the app will exit when A+C is pressed because the launcher picks that up.

while True:
display.keepalive()
display.halt()

0 comments on commit 7ec4fe6

Please sign in to comment.