I have these two different esp32 boards. Both have OLED displays.
I am using Micropython ( Thonny editor) to program the ssd 1306 display.
According to the pinouts the boards have the same SDA , SCL and RST pins. ( 4, 15 , 16 respectively)
I have it set up so that the main.py program reads the voltage from a POT on an ADC port (pin 36).
The program works fine on the wifi_kit_32 board and displays the voltage , but on the Lora board, it prints out the
voltage in the terminal screen but not on the OLED. I used the 0x3C I2C address for both boards.
I ran I2C scanner and it printed out about 50 I2C addresses, no idea why, but it didn’t help me find out if the address on the Lora board is different.
Thanks for the help
Double-check the pins that the OLED display of your LoRa boards is connected to.
It may not be connected to the default board’s I2C pins. It might be connected to other pins.
Thanks for the quick reply. It is almost impossible to tell. There is multiconductor ( approx 20 lines) flat cable running from the OLED to the surface of the boards. The multiconductor cable and its location look identical on both Heltec boards. The best that I can do is assume that they are the same. If you can think of another way to check more definitively, then I wlll try that.
Send me a link to the LoRa board that you have.
I’ll see if I can find the pinout.
Here is the link to the Heltec Lora board
and here is the link to the Heltec Kit board
Hope that this helps. I see that the physical layout of the pins is different between the two boards.
It seems that the board uses GPIOs 4 (SDA) and 16 (SCL) for the OLED.
So, you must tell the code to use those pins when initializing the OLED.
We have an I2C guide that shows how to use other I2C pins different than the default. https://randomnerdtutorials.com/esp32-i2c-communication-arduino-ide/#3
Let me know if this helps.
Thanks Sara for the reply.
I will read the link and see if that helps.
Cheers and Thank you.
I now have the Heltec Lora esp32 OLED display working.
I found this snippet of code online and using the pull_up resistors seems to have made the difference.
# Heltec LoRa 32 with OLED Display oled_width = 128 oled_height = 64 # OLED reset pin i2c_rst = Pin(16, Pin.OUT) # Initialize the OLED display i2c_rst.value(0) sleep(0.010) i2c_rst.value(1) # must be held high after initialization # Setup the I2C lines i2c_scl = Pin(15, Pin.OUT, Pin.PULL_UP) i2c_sda = Pin(4, Pin.OUT, Pin.PULL_UP) # Create the bus object i2c = I2C(scl=i2c_scl, sda=i2c_sda) # Create the display object oled = ssd1306.SSD1306_I2C(oled_width, oled_height, i2c) oled.fill(0) oled.text('Hello, World 1!', 0, 0) oled.text('Hello, World 2!', 0, 10) oled.text('Hello, World 3!', 0, 20) oled.text('Hello, World 4!', 0, 30) oled.show()
Thanks for your help and prompt replies.
So, is everything working right now?
Can I close this issue?