Merge pull request #318 from MichaelBell/better-help

Badger2040: Improve help, info, qrgen
This commit is contained in:
Philip Howard 2022-03-29 23:17:16 +01:00 committed by GitHub
commit ca39554d28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 15 deletions

View File

@ -2,7 +2,7 @@ import badger2040
from badger2040 import WIDTH
TEXT_SIZE = 0.45
LINE_HEIGHT = 16
LINE_HEIGHT = 20
display = badger2040.Badger2040()
display.led(128)
@ -12,29 +12,31 @@ display.rectangle(0, 0, WIDTH, 16)
display.thickness(1)
display.pen(15)
display.text("badgerOS", 3, 8, 0.4)
display.text("help", WIDTH - display.measure_text("help", 0.4) - 4, 8, 0.4)
display.pen(0)
y = 16 + int(LINE_HEIGHT / 2)
TEXT_SIZE = 0.62
y = 20 + int(LINE_HEIGHT / 2)
display.thickness(2)
display.text("Normal:", 0, y, TEXT_SIZE)
display.thickness(1)
y += LINE_HEIGHT
display.text("Up / Down - Change launcher page", 0, y, TEXT_SIZE)
display.font("sans")
display.text("Up/Down - Change page", 0, y, TEXT_SIZE)
y += LINE_HEIGHT
display.text("a, b or c - Launch app", 0, y, TEXT_SIZE)
y += LINE_HEIGHT
display.text("a & c - Exit app", 0, y, TEXT_SIZE)
y += LINE_HEIGHT
display.thickness(2)
display.text("Hold USER after:", 0, y, TEXT_SIZE)
display.thickness(1)
y += 8
display.text("Up/Down & User - Font size", 0, y, TEXT_SIZE)
y += LINE_HEIGHT
display.text("Up / Down - Change font size", 0, y, TEXT_SIZE)
y += LINE_HEIGHT
display.text("a - Toggle invert", 0, y, TEXT_SIZE)
display.text("a & User - Toggle invert", 0, y, TEXT_SIZE)
y += LINE_HEIGHT
display.update()
display.halt()
# 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.halt()

View File

@ -12,6 +12,7 @@ display.rectangle(0, 0, WIDTH, 16)
display.thickness(1)
display.pen(15)
display.text("badgerOS", 3, 8, 0.4)
display.text("info", WIDTH - display.measure_text("help", 0.4) - 4, 8, 0.4)
display.pen(0)
@ -34,4 +35,8 @@ y += LINE_HEIGHT
display.text("https://pimoroni.com/badger2040", 0, y, TEXT_SIZE)
display.update()
display.halt()
# 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.halt()

View File

@ -65,4 +65,8 @@ for line in detail_text:
top += 10
display.update()
display.halt()
# 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.halt()