OLED Display Detected on Raspberry Pi 4, But Not Displaying Anything - Need Help!
Posted: Fri Nov 08, 2024 3:27 pm
Hi everyone,
I’m trying to get my "0.96 Inch I2C/IIC 4pin OLED Display Module BLUE" to work with my Raspberry Pi 4, but I’m stuck. The display shows up when I scan for it on I2C (address 0x3C), but I can’t get anything to actually display on the screen.
Here’s what my setup looks like:
Setup Connections:
VCC to 3.3V (also tried 5V, no change)
GND to GND
SCL and SDA are wired to the correct I2C pins
Libraries: I’ve installed Adafruit_SSD1306, Adafruit_GFX, and tried luma.oled as well.
Code: My code initializes the display and attempts to print "Hello, World!" Here’s a simple version of it:
Python code:
import board
import busio
from adafruit_ssd1306 import SSD1306_I2C
from PIL import Image, ImageDraw, ImageFont
# I2C setup
i2c = busio.I2C(board.SCL, board.SDA)
oled_width = 128
oled_height = 64
# Initialize display
oled = SSD1306_I2C(oled_width, oled_height, i2c)
# Clear the display
oled.fill(0)
oled.show()
# Create a blank image for drawing
image = Image.new("1", (oled_width, oled_height))
draw = ImageDraw.Draw(image)
# Draw some text
font = ImageFont.load_default()
draw.text((0, 0), "Hello, OLED!", font=font, fill=255)
# Display image
oled.image(image)
oled.show()
What I’ve Tried
Double-checked Connections: All connections are solid and matched to the I2C pins.
Address Check: The I2C scan confirms the display is detected at 0x3C.
Power Supply: Tried both 3.3V and 5V—no difference.
Library Switching: I’ve tried multiple libraries to see if compatibility was an issue, but no luck.
Display Command: Ensured I’m calling display.display() to update the screen buffer.
I’m trying to get my "0.96 Inch I2C/IIC 4pin OLED Display Module BLUE" to work with my Raspberry Pi 4, but I’m stuck. The display shows up when I scan for it on I2C (address 0x3C), but I can’t get anything to actually display on the screen.
Here’s what my setup looks like:
Setup Connections:
VCC to 3.3V (also tried 5V, no change)
GND to GND
SCL and SDA are wired to the correct I2C pins
Libraries: I’ve installed Adafruit_SSD1306, Adafruit_GFX, and tried luma.oled as well.
Code: My code initializes the display and attempts to print "Hello, World!" Here’s a simple version of it:
Python code:
import board
import busio
from adafruit_ssd1306 import SSD1306_I2C
from PIL import Image, ImageDraw, ImageFont
# I2C setup
i2c = busio.I2C(board.SCL, board.SDA)
oled_width = 128
oled_height = 64
# Initialize display
oled = SSD1306_I2C(oled_width, oled_height, i2c)
# Clear the display
oled.fill(0)
oled.show()
# Create a blank image for drawing
image = Image.new("1", (oled_width, oled_height))
draw = ImageDraw.Draw(image)
# Draw some text
font = ImageFont.load_default()
draw.text((0, 0), "Hello, OLED!", font=font, fill=255)
# Display image
oled.image(image)
oled.show()
What I’ve Tried
Double-checked Connections: All connections are solid and matched to the I2C pins.
Address Check: The I2C scan confirms the display is detected at 0x3C.
Power Supply: Tried both 3.3V and 5V—no difference.
Library Switching: I’ve tried multiple libraries to see if compatibility was an issue, but no luck.
Display Command: Ensured I’m calling display.display() to update the screen buffer.