Skip to content

Commit d41e17b

Browse files
authored
Merge pull request #6 from makermelissa/master
Updated example so it runs on feather and looks great
2 parents ae2453c + af02301 commit d41e17b

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

examples/pcd8544_simpletest.py

+15-9
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,19 @@
77

88
# Initialize SPI bus and control pins
99
spi = busio.SPI(board.SCK, MOSI=board.MOSI)
10-
dc = digitalio.DigitalInOut(board.D5) # data/command
11-
cs = digitalio.DigitalInOut(board.D6) # Chip select
12-
reset = digitalio.DigitalInOut(board.D7) # reset
10+
dc = digitalio.DigitalInOut(board.D6) # data/command
11+
cs = digitalio.DigitalInOut(board.D5) # Chip select
12+
reset = digitalio.DigitalInOut(board.D9) # reset
1313

1414
display = adafruit_pcd8544.PCD8544(spi, dc, cs, reset)
15-
display.bias = 5
16-
display.contrast = 100
15+
16+
display.bias = 4
17+
display.contrast = 60
18+
19+
# Turn on the Backlight LED
20+
backlight = digitalio.DigitalInOut(board.D10) # backlight
21+
backlight.switch_to_output()
22+
backlight.value = True
1723

1824
print("Pixel test")
1925
# Clear the display. Always call show after changing pixels to make the display
@@ -28,7 +34,7 @@
2834
# Set a pixel in the opposite corner position.
2935
display.pixel(display.width-1, display.height-1, 1)
3036
display.show()
31-
time.sleep(0.1)
37+
time.sleep(2)
3238

3339
print("Lines test")
3440
# we'll draw from corner to corner, lets define all the pair coordinates here
@@ -41,7 +47,7 @@
4147
display.line(corner_from[0], corner_from[1],
4248
corner_to[0], corner_to[1], 1)
4349
display.show()
44-
time.sleep(0.1)
50+
time.sleep(2)
4551

4652
print("Rectangle test")
4753
display.fill(0)
@@ -50,14 +56,14 @@
5056
for i in range(11):
5157
display.rect(0, 0, int(w_delta*i), int(h_delta*i), 1)
5258
display.show()
53-
time.sleep(0.1)
59+
time.sleep(2)
5460

5561
print("Text test")
5662
display.fill(0)
5763
display.text('hello world', 0, 0, 1)
5864
display.text('this is the', 0, 8, 1)
5965
display.text('CircuitPython', 0, 16, 1)
60-
display.text('adafruit lib', 0, 24, 1)
66+
display.text('adafruit lib-', 0, 24, 1)
6167
display.text('rary for the', 0, 32, 1)
6268
display.text('PCD8544! :) ', 0, 40, 1)
6369

0 commit comments

Comments
 (0)