Skip to content

Add reset pin to examples #10

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
Jul 1, 2020
Merged
Show file tree
Hide file tree
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
10 changes: 7 additions & 3 deletions examples/ssd1305_simpletest.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
# Import all board pins.
from board import SCL, SDA
from board import SCL, SDA, D4
import busio
import digitalio

# Import the SSD1305 module.
import adafruit_ssd1305

# Define the Reset Pin
oled_reset = digitalio.DigitalInOut(D4)

# Create the I2C interface.
i2c = busio.I2C(SCL, SDA)

# Create the SSD1305 OLED class.
# The first two parameters are the pixel width and pixel height. Change these
# to the right size for your display!
display = adafruit_ssd1305.SSD1305_I2C(128, 32, i2c)
display = adafruit_ssd1305.SSD1305_I2C(128, 32, i2c, addr=0x3C, reset=oled_reset)

# Alternatively you can change the I2C address of the device with an addr parameter:
# display = adafruit_ssd1305.SSD1305_I2C(128, 32, i2c, addr=0x31)
# display = adafruit_ssd1305.SSD1305_I2C(128, 32, i2c, addr=0x31, reset=oled_reset)

# Clear the display. Always call show after changing pixels to make the display
# update visible!
Expand Down
8 changes: 5 additions & 3 deletions examples/ssd1305_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,22 @@

import time
import subprocess

from board import SCL, SDA
from board import SCL, SDA, D4
import busio
import digitalio
from PIL import Image, ImageDraw, ImageFont
import adafruit_ssd1305

# Define the Reset Pin
oled_reset = digitalio.DigitalInOut(D4)

# Create the I2C interface.
i2c = busio.I2C(SCL, SDA)

# Create the SSD1305 OLED class.
# The first two parameters are the pixel width and pixel height. Change these
# to the right size for your display!
disp = adafruit_ssd1305.SSD1305_I2C(128, 32, i2c)
disp = adafruit_ssd1305.SSD1305_I2C(128, 32, i2c, reset=oled_reset)

# Clear display.
disp.fill(0)
Expand Down