diff --git a/Adafruit_SSD1306/SSD1306.py b/Adafruit_SSD1306/SSD1306.py index f4ee132..c557956 100644 --- a/Adafruit_SSD1306/SSD1306.py +++ b/Adafruit_SSD1306/SSD1306.py @@ -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) diff --git a/examples/stats.py b/examples/stats.py index 54dea7a..ce1cb63 100644 --- a/examples/stats.py +++ b/examples/stats.py @@ -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