Browse Source

Update 'CARDPUTER CircuitPython/full_display_test.py'

cube 9 months ago
parent
commit
1990806aab
1 changed files with 7 additions and 0 deletions
  1. 7
    0
      CARDPUTER CircuitPython/full_display_test.py

+ 7
- 0
CARDPUTER CircuitPython/full_display_test.py View File

@@ -24,5 +24,12 @@ while True:
24 24
     elif key == "CTRLD":
25 25
         text = "Press CTRL+D to clear text\n\n"
26 26
     else:
27
+        ## WRAPPING
28
+        ## calculate wrapping when entering a character 
29
+        lines = text.split("\n")
30
+        current_line = lines[len(lines)-1]
31
+        if len(current_line) > 35:
32
+            text=text+"\n" # <- start a new line here
33
+        ##############################################
27 34
         text = text+key
28 35
     text_area.text = text