Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
ST7735.py
bmp.py
flower160x128.bmp
flower64x48.bmp
font5x7.fnt
lcd_gfx.py
main.py

README.md

MicroPython_ST7735S

Last update added support for a cheap 128x128 TFT display. offset - offsets the display by that number of pixels horizontally and vertically c_mode - Swaps around Blue and Red in the 565 colour packet. It seems some displays swap these.

Sample usage

import ST7735

# height defaults to 160
ST7735.ST7735_TFTHEIGHT = 128
spi = machine.SPI(1, baudrate=8000000, polarity=0, phase=0)

# move image 3 pixels across and down
# RGB is reversed = c_mode fixes that
d = ST7735.ST7735(offset=3, c_mode='BGR')
d.reset()
d.begin()
d._bground = 0xffff
d.fill_screen(d._bground)

This is for a 128 x 160 display that uses a different set of pins to the default

import ST7735
spi = machine.SPI(1, baudrate=8000000, polarity=0, phase=0)
d = ST7735.ST7735(spi, rst=4, ce=5, dc=16)
d.reset()
d.begin()
d._bground = 0xffff
d.fill_screen(d._bground)

.mpy versions are available in the releases

You can’t perform that action at this time.