Trouble connecting to SPI display sh1106
Posted: Thu Aug 08, 2019 12:58 am
I was able to get external OLED displays working with a Heltec wifi ESP8266 over SPI with SH1106 as follows:
from machine import I2C, Pin, SPI
oled_reset_pin = Pin(16, Pin.OUT)
spi = SPI(1, baudrate=800000)
display = sh1106.SH1106_SPI(128, 64, spi, dc=Pin(0), res=oled_reset_pin, cs=Pin(15))
display2 = sh1106.SH1106_SPI(128, 64, spi, dc=Pin(2), res=oled_reset_pin, cs=Pin(1))
I've been trying to get it work with the Heltec wifi ESP32 and have not been able to figure it out! The pinout diagram is here: https://github.com/dakschnitzer/time-gu ... t%2032.pdf
I have the SPI display connected to the ESP32 as follows, but I get nothing on the display:
CLK -> GPIO18 (SCK / V_SPI_CLK)
MOSI -> GPIO23 (MOSI / V_SPI_D)
RES -> GPIO16 (OLED_RST)
DC -> GPIO26 (no idea where this should go)
CS -> GPIO5 (V_SPI_CSO)
Please let me know if I am doing something wrong here. The code I'm trying to run on the esp32 to goet this to work is:
import sh1106
from machine import I2C, Pin, SPI
oled_reset_pin = Pin(16, Pin.OUT)
oled_reset_pin.value(1)
spi = SPI(1, baudrate=8000000)
display = sh1106.SH1106_SPI(128, 64, spi, dc=Pin(26), res=oled_reset_pin, cs=Pin(5))
I'm using this sh1106 driver: https://github.com/robert-hh/SH1106/blo ... /sh1106.py
from machine import I2C, Pin, SPI
oled_reset_pin = Pin(16, Pin.OUT)
spi = SPI(1, baudrate=800000)
display = sh1106.SH1106_SPI(128, 64, spi, dc=Pin(0), res=oled_reset_pin, cs=Pin(15))
display2 = sh1106.SH1106_SPI(128, 64, spi, dc=Pin(2), res=oled_reset_pin, cs=Pin(1))
I've been trying to get it work with the Heltec wifi ESP32 and have not been able to figure it out! The pinout diagram is here: https://github.com/dakschnitzer/time-gu ... t%2032.pdf
I have the SPI display connected to the ESP32 as follows, but I get nothing on the display:
CLK -> GPIO18 (SCK / V_SPI_CLK)
MOSI -> GPIO23 (MOSI / V_SPI_D)
RES -> GPIO16 (OLED_RST)
DC -> GPIO26 (no idea where this should go)
CS -> GPIO5 (V_SPI_CSO)
Please let me know if I am doing something wrong here. The code I'm trying to run on the esp32 to goet this to work is:
import sh1106
from machine import I2C, Pin, SPI
oled_reset_pin = Pin(16, Pin.OUT)
oled_reset_pin.value(1)
spi = SPI(1, baudrate=8000000)
display = sh1106.SH1106_SPI(128, 64, spi, dc=Pin(26), res=oled_reset_pin, cs=Pin(5))
I'm using this sh1106 driver: https://github.com/robert-hh/SH1106/blo ... /sh1106.py