"""
lines.py
Draws lines and rectangles in random colors at random locations on the
display.
"""
import random
from machine import Pin, SoftSPI ,SPI
import st7789py as st7789
# SCK 2
# MOSI 3
# MISO NC
# LED NC
# BACKLIGHT NC
def main():
spi = SPI(0,
baudrate=20000000,
polarity=1,
phase=0,
sck=Pin(2),
mosi=Pin(3),
miso=Pin(0))
tft = st7789.ST7789(
spi,
240,
240,
reset=Pin(6, Pin.OUT),
cs=Pin(8, Pin.OUT),
dc=Pin(7, Pin.OUT),
backlight=Pin(0, Pin.OUT),
rotation=1)
#tft.fill(st7789.WHITE)
tft.rect(40, 10, 120, 100, st7789.WHITE)
main()