Skip to content
Snippets Groups Projects
Commit 5014e0f0 authored by rohieb's avatar rohieb
Browse files

python: add example cat.py for bitmap text handling

parent a26b5592
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env python
import sys
import client
# read lines from stdin and write them to the display.
# includes scrolling.
# FIXME: scrolling is slow. use a pixel buffer and blitting.
if __name__ == "__main__":
y = 0
lines = []
line = sys.stdin.readline()
while(line != ""):
client.write(0, y, line)
lines.append(line)
if(y == client.NUM_SEG_Y):
lines.reverse()
lines.pop()
lines.reverse()
y = 0
for l in lines:
client.write(0, y, l)
y += 1
else:
y += 1
line = sys.stdin.readline()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment