Merge branch 'master' of https://github.com/adafruit/Adafruit_Python_SSD1306
This commit is contained in:
commit
b7eccd1c7a
2 changed files with 7 additions and 4 deletions
|
|
@ -85,7 +85,8 @@ class SSD1306Base(object):
|
|||
self._gpio = GPIO.get_platform_gpio()
|
||||
# Setup reset pin.
|
||||
self._rst = rst
|
||||
self._gpio.setup(self._rst, GPIO.OUT)
|
||||
if not self._rst is None:
|
||||
self._gpio.setup(self._rst, GPIO.OUT)
|
||||
# Handle hardware SPI
|
||||
if spi is not None:
|
||||
self._log.debug('Using hardware SPI')
|
||||
|
|
@ -150,6 +151,8 @@ class SSD1306Base(object):
|
|||
|
||||
def reset(self):
|
||||
"""Reset the display."""
|
||||
if self._rst is None:
|
||||
return
|
||||
# Set reset high for a millisecond.
|
||||
self._gpio.set_high(self._rst)
|
||||
time.sleep(0.001)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
# Copyright (c) 2014 Adafruit Industries
|
||||
# Author: Tony DiCola
|
||||
# Copyright (c) 2017 Adafruit Industries
|
||||
# Author: Tony DiCola & James DeVito
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
@ -30,7 +30,7 @@ from PIL import ImageFont
|
|||
import subprocess
|
||||
|
||||
# Raspberry Pi pin configuration:
|
||||
RST = 24
|
||||
RST = None # on the PiOLED this pin isnt used
|
||||
# Note the following are only used with SPI:
|
||||
DC = 23
|
||||
SPI_PORT = 0
|
||||
|
|
|
|||
Loading…
Reference in a new issue