import uos
from machine import Pin, SoftSPI ,SPI
import st7789py as st7789

import random
from machine import Pin, SoftSPI ,SPI
import st7789py as st7789

def main():
    spi = SPI(0,
        baudrate=20000000,
        polarity=1,
        phase=0,
        sck=Pin(18),
        mosi=Pin(23),
        )

    tft = st7789.ST7789(
        spi,
        240,
        240,
        reset=Pin(5, Pin.OUT),
        cs=Pin(15, Pin.OUT),
        dc=Pin(4, Pin.OUT),
        backlight=Pin(0, Pin.OUT),
        rotation=1)

    tft.fill(st7789.RED)
    tft.rect(40, 10, 120, 100, st7789.WHITE)



Loading
ili9341-cap-touch