Skip to content

Commit

Permalink
Added a function to clear the buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
evaherrada committed Oct 21, 2019
1 parent 23167c3 commit dc25b07
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions examples/framebuf_simpletest.py
Expand Up @@ -22,6 +22,12 @@ def print_buffer(the_fb):
print(".")
print("." * (the_fb.width+2))

# Small function to clear the buffer
def clear_buffer():
for i, _ in enumerate(buffer):
buffer[i] = 0


print("Shapes test: ")
fb.pixel(3, 5, True)
fb.rect(0, 0, fb.width, fb.height, True)
Expand All @@ -32,7 +38,12 @@ def print_buffer(the_fb):
print("Text test: ")
# empty
fb.fill_rect(0, 0, WIDTH, HEIGHT, False)

# write some text
fb.text("hello", 0, 0, True)
print_buffer(fb)
clear_buffer()

# write some larger text
fb.text("hello", 8, 0, True, size = 2)
print_buffer(fb)

0 comments on commit dc25b07

Please sign in to comment.