Skip to content

Updated example so it runs on feather and looks great #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 26, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions examples/pcd8544_simpletest.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,19 @@

# Initialize SPI bus and control pins
spi = busio.SPI(board.SCK, MOSI=board.MOSI)
dc = digitalio.DigitalInOut(board.D5) # data/command
cs = digitalio.DigitalInOut(board.D6) # Chip select
reset = digitalio.DigitalInOut(board.D7) # reset
dc = digitalio.DigitalInOut(board.D6) # data/command
cs = digitalio.DigitalInOut(board.D5) # Chip select
reset = digitalio.DigitalInOut(board.D9) # reset

display = adafruit_pcd8544.PCD8544(spi, dc, cs, reset)
display.bias = 5
display.contrast = 100

display.bias = 4
display.contrast = 60

# Turn on the Backlight LED
backlight = digitalio.DigitalInOut(board.D10) # backlight
backlight.switch_to_output()
backlight.value = True

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

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

print("Rectangle test")
display.fill(0)
Expand All @@ -50,14 +56,14 @@
for i in range(11):
display.rect(0, 0, int(w_delta*i), int(h_delta*i), 1)
display.show()
time.sleep(0.1)
time.sleep(2)

print("Text test")
display.fill(0)
display.text('hello world', 0, 0, 1)
display.text('this is the', 0, 8, 1)
display.text('CircuitPython', 0, 16, 1)
display.text('adafruit lib', 0, 24, 1)
display.text('adafruit lib-', 0, 24, 1)
display.text('rary for the', 0, 32, 1)
display.text('PCD8544! :) ', 0, 40, 1)

Expand Down