# tut komisch...

#--------------------------------------------------
# Module importieren
import machine
import time
import st7789
import vga2_16x32 as font

#--------------------------------------------------
# setup
spi = machine.SPI(2, baudrate=40000000, sck=machine.Pin(18), mosi=machine.Pin(23), miso=machine.Pin(19))
tft = st7789.ST7789(
    spi,
    240, 320,
    reset=machine.Pin(2, machine.Pin.OUT),
    cs=machine.Pin(15, machine.Pin.OUT),
    dc=machine.Pin(4, machine.Pin.OUT),
    rotation=0,
    color_order=st7789.BGR
    )

tft.inversion_mode(False)

#--------------------------------------------------
# loop
while True:
    # Text an Koordinate (x/y=30/90) ausgeben
    #"""
    tft.text(
        font,
        "TFT-Display",
        30, 90,
        st7789.color565(255, 0, 0), st7789.color565(0, 0, 0)
    )
    #"""
    """
    tft.text(
        font,
        "TFT-Display", 30, 90, st7789.RED, st7789.WHITE
    )
    """
    time.sleep(1)

    # Display löschen
    tft.fill(0)
    time.sleep(1)