v.0.3.2 font 8x8 16x16 pretty
This commit is contained in:
18
main.py
18
main.py
@@ -1,7 +1,7 @@
|
||||
# from machine import Pin, ADC # type: ignore
|
||||
from app.display.fonts.font_3x5 import font_3x5
|
||||
from app.display.fonts.font_5x7 import font_5x7
|
||||
from app.display.fonts.fonts_utils import align_font
|
||||
from app.display.fonts.fonts_utils import align_font, font_height
|
||||
from app.display.neopixel_64x64 import NeoPixel_64x64
|
||||
from app.utils.colors import BLUE, GREEN, ORANGE, RAINBOW, RED, WHITE, YELLOW, GOLD
|
||||
from app.utils.system_load import show_system_load
|
||||
@@ -44,15 +44,15 @@ def weather_check(test_mode: bool = False):
|
||||
|
||||
try:
|
||||
display.clear()
|
||||
display.write_text('search wlan', 0, 0, color=YELLOW)
|
||||
display.write_text('search wlan', 0, 0, color=WHITE)
|
||||
|
||||
display.clear_row(0, effect=False)
|
||||
|
||||
display.clear()
|
||||
display.set_font(font_3x5)
|
||||
display.write_text('wlan connected', 0, 0, color=RAINBOW[1])
|
||||
display.write_text('wlan connected', 0, 0, color=RAINBOW[0])
|
||||
display.write_text('querying', 0, 8, color=RAINBOW[1])
|
||||
display.write_text('weather data', 0, 16, color=RAINBOW[1])
|
||||
display.write_text('weather data', 0, 16, color=RAINBOW[2])
|
||||
|
||||
w_resp = wlan.actual_weather(lang='en', test_mode=test_mode)
|
||||
|
||||
@@ -85,6 +85,8 @@ def weather_check(test_mode: bool = False):
|
||||
def font_test(font) -> None:
|
||||
display.set_font(font)
|
||||
|
||||
height = font_height(font)
|
||||
|
||||
alphabet: str = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
|
||||
char_line_1 = alphabet[:11]
|
||||
char_line_2 = alphabet[11:22]
|
||||
@@ -92,7 +94,7 @@ def font_test(font) -> None:
|
||||
num_line = '0123456789'
|
||||
|
||||
row = 0
|
||||
incr = 6
|
||||
incr = height + 1
|
||||
display.write_text(num_line, 0, row)
|
||||
row += incr
|
||||
display.write_text(char_line_1.upper(), 0, row, YELLOW)
|
||||
@@ -139,8 +141,8 @@ def bit_arrays():
|
||||
|
||||
if __name__ == '__main__':
|
||||
# emoji_test()
|
||||
# font_test(font_3x5)
|
||||
font_test(font_16x16)
|
||||
# bit_arrays()
|
||||
# show_system_load()
|
||||
# font_pretty(font_3x5)
|
||||
weather_check(test_mode=True)
|
||||
font_pretty(font_16x16)
|
||||
# weather_check(test_mode=True)
|
||||
|
||||
Reference in New Issue
Block a user