Hello micropython community,
After days of try and error, I figured out how to use gcarver's ST7735 libary in the correct way:
gcarver's code is here:
https://github.com/GuyCarver/MicroPython
pins on the left, section tft:
cs -> X5
sck ->X6
sda ->X8
(you may use Y)
rs -> X1
rst -> X2
(or any other pins you want)
bl -> 5V
vcc -> 5V
gnd -> gnd
(only if your display supports 5V, my display supports 5V and is pretty dark on 3.3V)
sample code:
from sysfont import sysfont
from ST7735 import TFT
tft=TFT(1,'X1','X2')
tft.initr() # or initb() or initg() according to your display
tft.fill(0)
tft.text((0,0),'hallo welt',sysfont)
The Python libary does its job, but it's pretty slow. For that reason gcarver build a module for pyb. Unfortunately there hasn't been updates for a while. For that reason I pulled a fresh version of micropython-git and build it with the changes of gcarver's repo:
The repo is here:
https://github.com/GuyCarver/micropython-1/tree/TFT
You should use gcc 4.8
Problems I had:
- When testing the display with an Arduino Nano, I mustn't connect VCC and GND - BL was enough,
I just wondered why my display stayed dark
- for some reason the yellow pins on the left didn't work with the pyboard, although they worked with Arduino
- The Labeling of the pins was different to the documentation and gcarver's code (this is a big issue when u re a spi noob). If you are unsure, test with Arduino
I dont want to take any credits for gcarvers work. I'm just writing this because a post like this would have saved me hours of time.
If anyone is interested, I could post recent firmware images from time to time (as I build them for my project)
@gcarver, I couldn't reach you via PM. If you have a problem with me posting images containing your work, please pm me and I will take them down.
@gcarver, thanks for your work. I love this display