Skip to content

Commit

Permalink
Merge pull request #89 from pimoroni/examples/info-version
Browse files Browse the repository at this point in the history
info.py: added badger os version number
  • Loading branch information
Gadgetoid authored Jan 8, 2025
2 parents 88d716d + 46bd0cb commit 64c238d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions badger_os/examples/info.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import badger2040
from badger2040 import WIDTH
import version

TEXT_SIZE = 1
LINE_HEIGHT = 15

version = version.BUILD.split('-')[2]

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

Expand All @@ -30,16 +33,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(f"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 64c238d

Please sign in to comment.