mirror of
https://github.com/wahyd4/Adafruit_Python_SSD1306.git
synced 2026-08-09 04:46:43 +10:00
Add example of i2c bus config and software SPI.
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user