|
27 | 27 | # Sample code sections
|
28 | 28 | # ------------ SPI ------------------
|
29 | 29 | # 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 |
37 | 37 | #
|
38 | 38 | # for CS, D/C and Res other ports may be chosen.
|
39 | 39 | #
|
|
50 | 50 | # --------------- I2C ------------------
|
51 | 51 | #
|
52 | 52 | # 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 |
60 | 60 | #
|
61 |
| -# Pin's for I2C can be set almost arbitrary |
62 | 61 | #
|
63 | 62 | # from machine import Pin, I2C
|
64 | 63 | # import sh1106
|
65 | 64 | #
|
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) |
68 | 67 | # display.sleep(False)
|
69 | 68 | # display.fill(0)
|
70 | 69 | # display.text('Testing 1', 0, 0, 1)
|
|
0 commit comments