From 38a88d734679d4c20f1714655a1ff73d14da355f Mon Sep 17 00:00:00 2001 From: dobodu Date: Fri, 6 Sep 2024 23:00:23 +0200 Subject: [PATCH] small correction Small correction in exemples --- examples/hello_fixed_font_T4.py | 10 ++++++---- examples/hello_variable_font_T4.py | 12 ++++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/examples/hello_fixed_font_T4.py b/examples/hello_fixed_font_T4.py index 7034b82..6a8890b 100644 --- a/examples/hello_fixed_font_T4.py +++ b/examples/hello_fixed_font_T4.py @@ -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 @@ -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: @@ -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( diff --git a/examples/hello_variable_font_T4.py b/examples/hello_variable_font_T4.py index e63da78..e833bb4 100644 --- a/examples/hello_variable_font_T4.py +++ b/examples/hello_variable_font_T4.py @@ -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 @@ -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): @@ -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(