kopia lustrzana https://github.com/pimoroni/pimoroni-pico
Badger2040: Sync badge from beta build
rodzic
b92eb61d0d
commit
705a4de2fc
|
@ -25,6 +25,12 @@ OVERLAY_BORDER = 40
|
||||||
OVERLAY_SPACING = 20
|
OVERLAY_SPACING = 20
|
||||||
OVERLAY_TEXT_SIZE = 0.6
|
OVERLAY_TEXT_SIZE = 0.6
|
||||||
|
|
||||||
|
DEFAULT_TEXT = """mustelid inc
|
||||||
|
H. Badger
|
||||||
|
RP2040
|
||||||
|
2MB Flash
|
||||||
|
E ink
|
||||||
|
296x128px"""
|
||||||
|
|
||||||
BADGE_IMAGE = bytearray(int(IMAGE_WIDTH * HEIGHT / 8))
|
BADGE_IMAGE = bytearray(int(IMAGE_WIDTH * HEIGHT / 8))
|
||||||
|
|
||||||
|
@ -176,11 +182,10 @@ display.update_speed(badger2040.UPDATE_NORMAL)
|
||||||
try:
|
try:
|
||||||
badge = open("badge.txt", "r")
|
badge = open("badge.txt", "r")
|
||||||
except OSError:
|
except OSError:
|
||||||
display.pen(15)
|
badge = open("badge.txt", "w")
|
||||||
display.clear()
|
badge.write(DEFAULT_TEXT)
|
||||||
draw_overlay("To run this Badge demo, make sure there is a badge.txt file on your MicroPython device.", WIDTH - OVERLAY_BORDER, HEIGHT - OVERLAY_BORDER, OVERLAY_SPACING, OVERLAY_TEXT_SIZE)
|
badge.flush()
|
||||||
display.update()
|
badge.seek(0)
|
||||||
sys.exit()
|
|
||||||
|
|
||||||
# Read in the next 6 lines
|
# Read in the next 6 lines
|
||||||
company = badge.readline() # "mustelid inc"
|
company = badge.readline() # "mustelid inc"
|
||||||
|
|
Ładowanie…
Reference in New Issue