Skip to content

Commit 26a9c8a

Browse files
committed
Create a SSD1306 OLED class using default I2C address
1 parent 7ba1ae7 commit 26a9c8a

File tree

4 files changed

+32
-4
lines changed

4 files changed

+32
-4
lines changed

examples/ssd1306_pillow_clock.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,14 @@
2020

2121
i2c = board.I2C() # uses board.SCL and board.SDA
2222
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
23-
oled = adafruit_ssd1306.SSD1306_I2C(128, 64, i2c, addr=0x3D, reset=RESET_PIN)
23+
24+
# Create the SSD1306 OLED class.
25+
# The first two parameters are the pixel width and pixel height.
26+
# Change these to the right size for your display!
27+
oled = adafruit_ssd1306.SSD1306_I2C(128, 64, i2c)
28+
29+
# Note you can change the I2C address, or add a reset pin:
30+
# oled = adafruit_ssd1306.SSD1306_I2C(128, 64, i2c, addr=0x3D, reset=RESET_PIN)
2431

2532
# Clear display.
2633
oled.fill(0)

examples/ssd1306_pillow_image_display.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,14 @@
2020

2121
i2c = board.I2C() # uses board.SCL and board.SDA
2222
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
23-
oled = adafruit_ssd1306.SSD1306_I2C(128, 64, i2c, addr=0x3D, reset=RESET_PIN)
23+
24+
# Create the SSD1306 OLED class.
25+
# The first two parameters are the pixel width and pixel height.
26+
# Change these to the right size for your display!
27+
oled = adafruit_ssd1306.SSD1306_I2C(128, 64, i2c)
28+
29+
# Note you can change the I2C address, or add a reset pin:
30+
# oled = adafruit_ssd1306.SSD1306_I2C(128, 64, i2c, addr=0x3D, reset=RESET_PIN)
2431

2532
# Clear display.
2633
oled.fill(0)

examples/ssd1306_pillow_ip.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,14 @@ def get_ip_address(ifname):
3737
# Very important... This lets py-gaugette 'know' what pins to use in order to reset the display
3838
i2c = board.I2C() # uses board.SCL and board.SDA
3939
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
40-
oled = adafruit_ssd1306.SSD1306_I2C(128, 64, i2c, addr=0x3D, reset=RESET_PIN)
40+
41+
# Create the SSD1306 OLED class.
42+
# The first two parameters are the pixel width and pixel height.
43+
# Change these to the right size for your display!
44+
oled = adafruit_ssd1306.SSD1306_I2C(128, 64, i2c)
45+
46+
# Note you can change the I2C address, or add a reset pin:
47+
# oled = adafruit_ssd1306.SSD1306_I2C(128, 64, i2c, addr=0x3D, reset=RESET_PIN)
4148

4249
# This sets TEXT equal to whatever your IP address is, or isn't
4350
try:

examples/ssd1306_pillow_text.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,14 @@
2020
# Very important... This lets py-gaugette 'know' what pins to use in order to reset the display
2121
i2c = board.I2C() # uses board.SCL and board.SDA
2222
# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller
23-
oled = adafruit_ssd1306.SSD1306_I2C(128, 64, i2c, addr=0x3D, reset=RESET_PIN)
23+
24+
# Create the SSD1306 OLED class.
25+
# The first two parameters are the pixel width and pixel height.
26+
# Change these to the right size for your display!
27+
oled = adafruit_ssd1306.SSD1306_I2C(128, 64, i2c)
28+
29+
# Note you can change the I2C address, or add a reset pin:
30+
# oled = adafruit_ssd1306.SSD1306_I2C(128, 64, i2c, addr=0x3D, reset=RESET_PIN)
2431

2532
# Clear display.
2633
oled.fill(0)

0 commit comments

Comments
 (0)