0

connection of OLED display to ESP32 feather using SPI
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

connection of OLED display to ESP32 feather using SPI

by j_hofland on Mon Jul 26, 2021 11:17 pm

First time trying to use Arduino to interface ESP32 feather with 0.96" OLED using SPI.
Which ESP32 pins should be used for D/C, CS, and RST and how do I assign the when running the demo program?

j_hofland
 
Posts: 7
Joined: Sat Sep 09, 2017 5:23 pm

Re: connection of OLED display to ESP32 feather using SPI

by adafruit_support_carter on Tue Jul 27, 2021 1:21 pm

Which specific OLED are you using? Can you link to product page. Hopefully it's covered in the product guide, but first want to make sure which exact OLED you have.

adafruit_support_carter
 
Posts: 21061
Joined: Tue Nov 29, 2016 2:45 pm

Re: connection of OLED display to ESP32 feather using SPI

by j_hofland on Thu Jul 29, 2021 10:03 am

The OLED is #326, 128x64, 0.96". I have cut the internal traces that configure it for I2C and pinned it for SPI. I also have one of the #2719 2.4" display but figure I would try the smaller one forst.

j_hofland
 
Posts: 7
Joined: Sat Sep 09, 2017 5:23 pm

Re: connection of OLED display to ESP32 feather using SPI

by adafruit_support_carter on Thu Jul 29, 2021 11:14 am

The Feather ESP32 pinouts are documented here:
https://learn.adafruit.com/adafruit-huz ... er/pinouts

Here's the example to try for that OLED in SPI mode:
https://github.com/adafruit/Adafruit_SS ... 64_spi.ino

You can either use software SPI and configure it to use any available GPIO pins:
Code: Select all | TOGGLE FULL SIZE
// Declaration for SSD1306 display connected using software SPI (default case):
#define OLED_MOSI   9
#define OLED_CLK   10
#define OLED_DC    11
#define OLED_CS    12
#define OLED_RESET 13
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT,
  OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);


Or use hardware SPI specifying GPIO pins for DC, CS, and RESET:
Code: Select all | TOGGLE FULL SIZE
#define OLED_DC     6
#define OLED_CS     7
#define OLED_RESET  8
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT,
  &SPI, OLED_DC, OLED_RESET, OLED_CS);

adafruit_support_carter
 
Posts: 21061
Joined: Tue Nov 29, 2016 2:45 pm

Please be positive and constructive with your questions and comments.