Created
March 28, 2021 12:01
-
-
Save jake-walker/bf6b7a13cac539551a30248c8e259bbf to your computer and use it in GitHub Desktop.
ST7735 Update
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo python3 -m pip uninstall ST7735 Adafruit-GPIO | |
sudo python3 -m pip install st7735 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PIL import Image | |
from PIL import ImageDraw | |
from PIL import ImageFont | |
import ST7735 | |
disp = ST7735.ST7735(port=0, cs=0, dc=24, backlight=None, rst=25, width=128, height=160, rotation=0, invert=False) | |
WIDTH = disp.width | |
HEIGHT = disp.height | |
img = Image.new('RGB', (WIDTH, HEIGHT)) | |
draw = ImageDraw.Draw(img) | |
# Load default font. | |
font = ImageFont.load_default() | |
# Write some text | |
draw.text((5, 5), "Hello World!", font=font, fill=(255, 255, 255)) | |
# Write buffer to display hardware, must be called to make things visible on the | |
# display! | |
disp.display(img) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment