Nicer charset display
This commit is contained in:
parent
300323853b
commit
01c5e8bd2a
1 changed files with 26 additions and 14 deletions
|
@ -62,6 +62,26 @@ def text_raw(display, page, row, text):
|
|||
return display.send_command(0x11, 0x00, data, expect_response=False)
|
||||
|
||||
|
||||
def charset():
|
||||
lines = []
|
||||
for i in range(0, 256, 16):
|
||||
label = f"{i:03d}: "
|
||||
b = list(label.encode("CP437"))
|
||||
for j in range(i, i+16):
|
||||
if j == 0:
|
||||
b.append(0x20)
|
||||
else:
|
||||
b.append(j)
|
||||
lines.append(b)
|
||||
|
||||
display.set_page(1)
|
||||
|
||||
while True:
|
||||
for p in range(1,16):
|
||||
for l in range(0,4):
|
||||
text_raw(display, 1, l, lines[(p+l-1) % len(lines)])
|
||||
sleep(5)
|
||||
|
||||
print("Opening serial port")
|
||||
display = MIS1TextDisplay("/dev/ttyUSB0")
|
||||
|
||||
|
@ -80,12 +100,12 @@ display.debug = True
|
|||
r = get_config(display)
|
||||
print(f"reply {len(r)}: {r}")
|
||||
|
||||
display.simple_text(page=1, row=0, col=0, text="MEOW MEOW MEOW MEOW MEOW MEOW MEOW MEOW", align=display.ALIGN_CENTER)
|
||||
display.simple_text(page=1, row=1, col=0, text="MEOW MEOW MEOW MEOW MEOW MEOW MEOW MEOW", align=display.ALIGN_CENTER)
|
||||
display.simple_text(page=1, row=2, col=0, text="MEOW MEOW MEOW MEOW MEOW MEOW MEOW MEOW", align=display.ALIGN_CENTER)
|
||||
display.simple_text(page=1, row=3, col=0, text="MEOW MEOW MEOW MEOW MEOW MEOW MEOW MEOW", align=display.ALIGN_CENTER)
|
||||
#display.simple_text(page=1, row=0, col=0, text="MEOW MEOW MEOW MEOW MEOW MEOW MEOW MEOW", align=display.ALIGN_CENTER)
|
||||
#display.simple_text(page=1, row=1, col=0, text="MEOW MEOW MEOW MEOW MEOW MEOW MEOW MEOW", align=display.ALIGN_CENTER)
|
||||
#display.simple_text(page=1, row=2, col=0, text="MEOW MEOW MEOW MEOW MEOW MEOW MEOW MEOW", align=display.ALIGN_CENTER)
|
||||
#display.simple_text(page=1, row=3, col=0, text="MEOW MEOW MEOW MEOW MEOW MEOW MEOW MEOW", align=display.ALIGN_CENTER)
|
||||
|
||||
display.simple_text(page=0, row=3, col=0, text="MEOW MEOW MEOW MEOW MEOW MEOW", align=display.ALIGN_CENTER)
|
||||
#display.simple_text(page=0, row=3, col=0, text="MEOW MEOW MEOW MEOW MEOW MEOW", align=display.ALIGN_CENTER)
|
||||
|
||||
#print("page 1")
|
||||
#display.set_page(1)
|
||||
|
@ -101,13 +121,5 @@ display.simple_text(page=0, row=3, col=0, text="MEOW MEOW MEOW MEOW MEOW MEOW",
|
|||
#display.set_page(1)
|
||||
#sleep(10)
|
||||
|
||||
display.set_pages(((0,5), (1,5), (2,5), (3,5), (4,5), (5,5)))
|
||||
for p in range(0,6):
|
||||
for l in range(0,4):
|
||||
b = []
|
||||
for c in range(0,16):
|
||||
b.append(((((l+p) % 6) + 2) * 16) + c)
|
||||
text_raw(display, p, l, b)
|
||||
|
||||
|
||||
charset()
|
||||
print("Thats all, folks!")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue