Skip to content

Commit

Permalink
Merge pull request #24 from makermelissa/master
Browse files Browse the repository at this point in the history
Update Pillow Demo for latest version
  • Loading branch information
makermelissa authored Apr 1, 2024
2 parents 404a6f5 + dda5d65 commit 9f6be44
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/sharpmemorydisplay_pillow_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
scs = digitalio.DigitalInOut(board.D6) # inverted chip select

# display = adafruit_sharpmemorydisplay.SharpMemoryDisplay(spi, scs, 96, 96)
# display = adafruit_sharpmemorydisplay.SharpMemoryDisplay(spi, scs, 400, 240)
display = adafruit_sharpmemorydisplay.SharpMemoryDisplay(spi, scs, 144, 168)

# Clear display.
Expand Down Expand Up @@ -56,7 +57,8 @@

# Draw Some Text
text = "Hello World!"
(font_width, font_height) = font.getsize(text)
bbox = font.getbbox(text)
(font_width, font_height) = bbox[2] - bbox[0], bbox[3] - bbox[1]
draw.text(
(display.width // 2 - font_width // 2, display.height // 2 - font_height // 2),
text,
Expand Down

0 comments on commit 9f6be44

Please sign in to comment.