From 0466cf7d03eb4cb3b5c63779897395aba00ec564 Mon Sep 17 00:00:00 2001 From: Tony DiCola Date: Tue, 24 Jun 2014 13:04:47 -0700 Subject: [PATCH] Add example of i2c bus config and software SPI. --- examples/shapes.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/examples/shapes.py b/examples/shapes.py index 4156995..f788571 100644 --- a/examples/shapes.py +++ b/examples/shapes.py @@ -48,12 +48,21 @@ disp = Adafruit_SSD1306.SSD1306_128_32(rst=RST) # 128x64 display with hardware I2C: # disp = Adafruit_SSD1306.SSD1306_128_64(rst=RST) +# Alternatively you can specify an explicit I2C bus number, for example +# with the 128x32 display you would use: +# disp = Adafruit_SSD1306.SSD1306_128_32(rst=RST, i2c_bus=2) + # 128x32 display with hardware SPI: # disp = Adafruit_SSD1306.SSD1306_128_32(rst=RST, dc=DC, spi=SPI.SpiDev(SPI_PORT, SPI_DEVICE, max_speed_hz=8000000)) # 128x64 display with hardware SPI: # disp = Adafruit_SSD1306.SSD1306_128_64(rst=RST, dc=DC, spi=SPI.SpiDev(SPI_PORT, SPI_DEVICE, max_speed_hz=8000000)) +# Alternatively you can specify a software SPI implementation by providing +# digital GPIO pin numbers for all the required display pins. For example +# on a Raspberry Pi with the 128x32 display you might use: +# disp = Adafruit_SSD1306.SSD1306_128_32(rst=RST, dc=DC, sclk=18, din=25, cs=22) + # Initialize library. disp.begin()