Update 9.5
IDK what i'm doing wrong, i do not get any output on any of the 2" displays. SPI is enabled, and I checked the wiring more times that I am willing to admit
Wiring:
ST7789 ---> PinRaspberry Pi
VCC---> 3.3V (Pin 1)
GND---> GND (Pin 6)
SCL---> GPIO 11 (Pin 23)
SDA---> GPIO 10 (Pin 19)
RES---> GPIO 25 (Pin 22)
DC ---> GPIO 24 (Pin 18)
CS ---> GPIO 8 (Pin 24)
BLK---> GPIO 18 (Pin 12)
Test Code:
import time
import RPi.GPIO as GPIO
from PIL import Image
import st7789
# Suppress warnings from GPIO
GPIO.setwarnings(False)
# Set up GPIO pins for Reset (RST) and Backlight (BLK)
GPIO.setmode(GPIO.BCM)
# Initialize GPIO pins for display control
GPIO.setup(18, GPIO.OUT) # Backlight (BLK)
GPIO.setup(25, GPIO.OUT) # Reset (RES)
GPIO.output(18, GPIO.HIGH) # Turn on backlight
# Reset the display
GPIO.output(25, GPIO.LOW) # Pull the RESET pin low to reset the display
time.sleep(0.1) # Wait for 100ms
GPIO.output(25, GPIO.HIGH) # Pull the RESET pin high to finish the reset
time.sleep(0.1) # Wait for 100ms
# Initialize the display
disp = st7789.ST7789(
height=320, # Display height
width=240, # Display width
rotation=0, # Rotation (0, 90, 180, 270)
port=0, # SPI bus 0
cs=0, # Chip select pin (CE0)
dc=24, # Data/Command pin
backlight=18, # Backlight pin
rst=25, # Reset pin
spi_speed_hz=2000000 # SPI speed (2 MHz)
)
# Start the display
disp.begin()
# Create an image with a red background (RGB: Red=255, Green=0, Blue=0)
image = Image.new("RGB", (disp.width, disp.height), color=(255, 0, 0))
# Display the image
disp.display(image)
# Keep the red screen on for 5 seconds
time.sleep(5)
# Optionally clear the screen after displaying
disp.clear()
And "dmesg | grep spi" shows no spi related errors, also tried different Hz speeds
all dependencies are installed, I'm really at a Los
maybe it's too late at night and i need to work on it with a fresh mind tomorrow morning. But i would be thankful for any advice
IDK what i'm doing wrong, i do not get any output on any of the 2" displays. SPI is enabled, and I checked the wiring more times that I am willing to admit
Wiring:
ST7789 ---> PinRaspberry Pi
VCC---> 3.3V (Pin 1)
GND---> GND (Pin 6)
SCL---> GPIO 11 (Pin 23)
SDA---> GPIO 10 (Pin 19)
RES---> GPIO 25 (Pin 22)
DC ---> GPIO 24 (Pin 18)
CS ---> GPIO 8 (Pin 24)
BLK---> GPIO 18 (Pin 12)
Test Code:
import time
import RPi.GPIO as GPIO
from PIL import Image
import st7789
# Suppress warnings from GPIO
GPIO.setwarnings(False)
# Set up GPIO pins for Reset (RST) and Backlight (BLK)
GPIO.setmode(GPIO.BCM)
# Initialize GPIO pins for display control
GPIO.setup(18, GPIO.OUT) # Backlight (BLK)
GPIO.setup(25, GPIO.OUT) # Reset (RES)
GPIO.output(18, GPIO.HIGH) # Turn on backlight
# Reset the display
GPIO.output(25, GPIO.LOW) # Pull the RESET pin low to reset the display
time.sleep(0.1) # Wait for 100ms
GPIO.output(25, GPIO.HIGH) # Pull the RESET pin high to finish the reset
time.sleep(0.1) # Wait for 100ms
# Initialize the display
disp = st7789.ST7789(
height=320, # Display height
width=240, # Display width
rotation=0, # Rotation (0, 90, 180, 270)
port=0, # SPI bus 0
cs=0, # Chip select pin (CE0)
dc=24, # Data/Command pin
backlight=18, # Backlight pin
rst=25, # Reset pin
spi_speed_hz=2000000 # SPI speed (2 MHz)
)
# Start the display
disp.begin()
# Create an image with a red background (RGB: Red=255, Green=0, Blue=0)
image = Image.new("RGB", (disp.width, disp.height), color=(255, 0, 0))
# Display the image
disp.display(image)
# Keep the red screen on for 5 seconds
time.sleep(5)
# Optionally clear the screen after displaying
disp.clear()
And "dmesg | grep spi" shows no spi related errors, also tried different Hz speeds
all dependencies are installed, I'm really at a Los
maybe it's too late at night and i need to work on it with a fresh mind tomorrow morning. But i would be thankful for any advice
Statistics: Posted by MikeGotWine — Fri Nov 29, 2024 10:37 pm