Skip to content

Commit

Permalink
small correction
Browse files Browse the repository at this point in the history
Small correction in exemples
  • Loading branch information
dobodu committed Sep 6, 2024
1 parent 7cedfeb commit 38a88d7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
10 changes: 6 additions & 4 deletions examples/hello_fixed_font_T4.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def main():
tft.rotation(3)
tft.fill(rm690b0.RED)

text = "Hello"
text = "Hello!"
length = len(text) * font.WIDTH
height = font.HEIGHT

Expand All @@ -42,8 +42,10 @@ def main():
utime.sleep(2)
tft.fill(rm690b0.BLACK)

for i in range(4000):
tft.pixel(i,i,rm690b0.WHITE)
for i in range(40000):
tft.pixel(random.randint(0, tft.width()),
random.randint(0, tft.height()),
rm690b0.WHITE)


while True:
Expand All @@ -57,7 +59,7 @@ def main():
for _ in range(128):
tft.text(
font,
b'Hello!',
text,
random.randint(0, col_max),
random.randint(0, row_max),
tft.colorRGB(
Expand Down
12 changes: 8 additions & 4 deletions examples/hello_variable_font_T4.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ def main():
tft.reset()
tft.init()
tft.rotation(3)
a = tft.version
print(a)
tft.fill(rm690b0.RED)

text = "Hello"
text = "Hello!"
length = tft.write_len(font,text)
height = font.HEIGHT

Expand All @@ -32,8 +34,10 @@ def main():
utime.sleep(2)
tft.fill(rm690b0.BLACK)

for i in range(4000):
tft.pixel(i,i,rm690b0.WHITE)
for i in range(40000):
tft.pixel(random.randint(0, tft.width()),
random.randint(0, tft.height()),
rm690b0.WHITE)

while True:
for rotation in range(4):
Expand All @@ -45,7 +49,7 @@ def main():
for _ in range(128):
tft.write(
font,
b'Hello!',
text,
random.randint(0, col_max),
random.randint(0, row_max),
tft.colorRGB(
Expand Down

0 comments on commit 38a88d7

Please sign in to comment.