Skip to content

Instantly share code, notes, and snippets.

@boochow
Created October 10, 2019 15:43
Show Gist options
  • Save boochow/75ed8c826420c72aaec975edf9ac270e to your computer and use it in GitHub Desktop.
Save boochow/75ed8c826420c72aaec975edf9ac270e to your computer and use it in GitHub Desktop.
from ST7735 import TFT
from machine import SPI,Pin
import time
spi = SPI(2, baudrate=20000000, polarity=0, phase=0, sck=Pin(14), mosi=Pin(13), miso=Pin(12))
tft=TFT(spi,16,17,18)
tft.initb2()
tft.rgb(True)
tft.setvscroll(17, 17)
tft.fill(TFT.BLACK)
tft.fillrect((0, 0), (128, 16), TFT.PURPLE)
tft.fillrect((0, 144), (128, 16), TFT.CYAN)
tft.fillcircle((64, 80), 64, TFT.YELLOW)
tft.fillcircle((48, 60), 4, TFT.BLACK)
tft.fillcircle((80, 60), 4, TFT.BLACK)
tft.fillrect((32, 100), (64, 2), TFT.BLACK)
for i in range(0, 129):
tft.vscroll(i)
time.sleep_ms(50)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment