Skip to content

Commit 95cac13

Browse files
authored
Merge pull request #34 from makermelissa/master
Minor updates for guide
2 parents 6b60c34 + bb06066 commit 95cac13

File tree

3 files changed

+8
-14
lines changed

3 files changed

+8
-14
lines changed

examples/rgb_display_pillow_demo.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
BORDER = 20
88
FONTSIZE = 24
99

10-
# Configuration for CS and DC pins (these are FeatherWing defaults on M0/M4):
10+
# Configuration for CS and DC pins (these are PiTFT defaults):
1111
cs_pin = digitalio.DigitalInOut(board.CE0)
1212
dc_pin = digitalio.DigitalInOut(board.D25)
1313
reset_pin = digitalio.DigitalInOut(board.D24)
1414

1515
# Config for display baudrate (default max is 24mhz):
16-
BAUDRATE = 24000000
16+
BAUDRATE = 64000000
1717

1818
# Setup SPI bus using hardware SPI:
1919
spi = board.SPI()

examples/rgb_display_pillow_image.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from PIL import Image, ImageDraw
44
import adafruit_rgb_display.ili9341 as ili9341
55

6-
# Configuration for CS and DC pins (these are FeatherWing defaults on M0/M4):
6+
# Configuration for CS and DC pins (these are PiTFT defaults):
77
cs_pin = digitalio.DigitalInOut(board.CE0)
88
dc_pin = digitalio.DigitalInOut(board.D25)
99
reset_pin = digitalio.DigitalInOut(board.D24)

examples/rgb_display_pillow_stats.py

+5-11
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
from PIL import Image, ImageDraw, ImageFont
66
import adafruit_rgb_display.ili9341 as ili9341
77

8-
# Configuration for CS and DC pins (these are FeatherWing defaults on M0/M4):
8+
# Configuration for CS and DC pins (these are PiTFT defaults):
99
cs_pin = digitalio.DigitalInOut(board.CE0)
1010
dc_pin = digitalio.DigitalInOut(board.D25)
1111
reset_pin = digitalio.DigitalInOut(board.D24)
1212

1313
# Config for display baudrate (default max is 24mhz):
14-
BAUDRATE = 24000000
14+
BAUDRATE = 64000000
1515

1616
# Setup SPI bus using hardware SPI:
1717
spi = board.SPI()
@@ -33,17 +33,11 @@
3333
draw.rectangle((0, 0, width, height), outline=0, fill=(0, 0, 0))
3434
disp.image(image, rotation)
3535

36-
# Draw some shapes.
37-
# First define some constants to allow easy resizing of shapes.
36+
# First define some constants to allow easy positioning of text.
3837
padding = -2
39-
top = padding
40-
bottom = height-padding
41-
42-
# Move left to right keeping track of the current x position for drawing shapes.
4338
x = 0
4439

45-
46-
# Alternatively load a TTF font. Make sure the .ttf font file is in the
40+
# Load a TTF font. Make sure the .ttf font file is in the
4741
# same directory as the python script!
4842
# Some other nice fonts to try: http://www.dafont.com/bitmap.php
4943
font = ImageFont.truetype('/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf', 24)
@@ -66,7 +60,7 @@
6660
Temp = subprocess.check_output(cmd, shell=True).decode("utf-8")
6761

6862
# Write four lines of text.
69-
y = top
63+
y = padding
7064
draw.text((x, y), IP, font=font, fill="#FFFFFF")
7165
y += font.getsize(IP)[1]
7266
draw.text((x, y), CPU, font=font, fill="#FFFF00")

0 commit comments

Comments
 (0)