Skip to content

Commit 9f2c3f0

Browse files
author
Alasdair Allan
authored
Merge pull request raspberrypi#32 from robert-hh/master
sh1106.py: Fix the pin numbers in the example code.
2 parents 6baee41 + 4cc2b02 commit 9f2c3f0

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

i2c/1106oled/sh1106.py

+16-17
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@
2727
# Sample code sections
2828
# ------------ SPI ------------------
2929
# Pin Map SPI
30-
# - 3v - xxxxxx - Vcc
31-
# - G - xxxxxx - Gnd
32-
# - D7 - GPIO 13 - Din / MOSI fixed
33-
# - D5 - GPIO 14 - Clk / Sck fixed
34-
# - D8 - GPIO 4 - CS (optional, if the only connected device)
35-
# - D2 - GPIO 5 - D/C
36-
# - D1 - GPIO 2 - Res
30+
# - 3V3 - Vcc
31+
# - GND - Gnd
32+
# - GPIO 11 - DIN / MOSI fixed
33+
# - GPIO 10 - CLK / Sck fixed
34+
# - GPIO 4 - CS (optional, if the only connected device, connect to GND)
35+
# - GPIO 5 - D/C
36+
# - GPIO 2 - Res
3737
#
3838
# for CS, D/C and Res other ports may be chosen.
3939
#
@@ -50,21 +50,20 @@
5050
# --------------- I2C ------------------
5151
#
5252
# Pin Map I2C
53-
# - 3v - xxxxxx - Vcc
54-
# - G - xxxxxx - Gnd
55-
# - D2 - GPIO 5 - SCK / SCL
56-
# - D1 - GPIO 4 - DIN / SDA
57-
# - D0 - GPIO 16 - Res
58-
# - G - xxxxxx CS
59-
# - G - xxxxxx D/C
53+
# - 3V3 - Vcc
54+
# - GND - Gnd
55+
# - GPIO 5 - CLK / SCL
56+
# - GPIO 4 - DIN / SDA
57+
# - GPIO 2 - Res
58+
# - GND - CS
59+
# - GND - D/C
6060
#
61-
# Pin's for I2C can be set almost arbitrary
6261
#
6362
# from machine import Pin, I2C
6463
# import sh1106
6564
#
66-
# i2c = I2C(scl=Pin(5), sda=Pin(4), freq=400000)
67-
# display = sh1106.SH1106_I2C(128, 64, i2c, Pin(16), 0x3c)
65+
# i2c = I2C(0, scl=Pin(5), sda=Pin(4), freq=400000)
66+
# display = sh1106.SH1106_I2C(128, 64, i2c, Pin(2), 0x3c)
6867
# display.sleep(False)
6968
# display.fill(0)
7069
# display.text('Testing 1', 0, 0, 1)

0 commit comments

Comments
 (0)