0

Can someone provide source code for interfacing oled display with esp32-cam either using gpio13-14 or tx/rx pins or even using any available pins on the esp32 cam. I am not using the sd card reader. Moreover, i want to display texts over wifi to the oled.

2 Answers2

3

Well after searching i found the following solution which worked for me. For SDA and SCL i used pin 15 and pin 13 respectively ('SSD1306 display(0x3c, 15, 13);' this is the code which i changed) . I used this source code that i found online.

  • Would you please embed the relevant pieces of code from the tutorial into your answer to make it more helpful to others on stack overflow? – Willis Hershey Apr 19 '22 at 13:09
  • Using the above knowledge and this link I achieved this: https://randomnerdtutorials.com/micropython-oled-display-esp32-esp8266/ – jouell Aug 02 '22 at 02:13
1

Given the above info and the following link:

https://randomnerdtutorials.com/micropython-oled-display-esp32-esp8266/

I got my "bare" (not the esp32-cam-mb) esp32-cam to connect to the oled, while connected to the FTDI as well. The RNT link does not speak of the esp32 cam per se but their code works given the GPIOs above from https://stackoverflow.com/users/18790624/itsme-halewat

from machine import Pin, SoftI2C
import ssd1306
from time import sleep

# ESP32 Pin assignment 
i2c = SoftI2C(scl=Pin(13), sda=Pin(15))

# ESP8266 Pin assignment
#i2c = SoftI2C(scl=Pin(5), sda=Pin(4))

oled_width = 128
oled_height = 64
oled = ssd1306.SSD1306_I2C(oled_width, oled_height, i2c)

oled.text('Hello, World 1!', 0, 0)
oled.text('Hello, World 2!', 0, 10)
oled.text('Hello, World 3!', 0, 20)
        
oled.show()
jouell
  • 3,288
  • 1
  • 18
  • 15