Page 1 of 1

Need help with camera and screen project

Posted: Sat Jul 18, 2026 4:03 pm
by TheRealThreeeye
Hardware:
ESP: ESP-32-S3-WROOM-1
Camera: OV5640 (18 pins)
Screen: ST7789V (2inch, 240x320) (8 pins)

Dev setup:
OS: Linux Mint 23
IDE: VS Code
ESP-IDF: v6.0.1

Problem:
I'm trying to get the screen to show the camera, but it's all messed up.
I'm trying (Claude is trying) to modify a dvp_spi_lcd example with no real luck...
I'm attaching the dvp_spi_lcd_main.c, some logs and a photo of the screen.

Current physical pins to GPIO:
Screen:
VCC > 3.3v
GND > GND
DIN > GPIO 11
CLK > GPIO 12
CS > GPIO 21
DC > GPIO 47
RST > 3.3v
BL > GPIO 18

Camera:
3.3v > 3.3v
GND > GND
SIOC > GPIO 4
SIOD > GPIO 5
VSYNC > GPIO 14
HREF > GPIO 16
PCLK > GPIO 13
XCLK > GPIO 10
D9 > GPIO 40
D8 > GPIO 48
D7 > GPIO 45
D6 > GPIO 9
D5 > GPIO 8
D4 > GPIO 17
D3 > GPIO 7
D2 > GPIO 6
RST > not connected
PWDN > GND

Main/CMakeLists.txt (I guess the attachment limit is 3 files...):
idf_component_register(SRCS "dvp_spi_lcd_main.c"
INCLUDE_DIRS "."
REQUIRES esp_lcd driver esp_driver_ledc esp_camera)

Note:
If you'll suggest changing the GPIO pins, keep in mind that I need pins for buttons that'll be under a Resistor Ladder, and some sort of a battery % monitor...

Thanks for the help.

Re: Need help with camera and screen project

Posted: Sun Jul 19, 2026 12:36 pm
by nopnop2002

Code: Select all

        .pixel_format   = PIXFORMAT_RGB565,

You can use JPEG as the camera's capture format.

Here is an example of displaying JPEGs on the ST7789.
https://github.com/nopnop2002/esp-idf-st7789

Re: Need help with camera and screen project

Posted: Sun Jul 19, 2026 1:18 pm
by TheRealThreeeye
Thanks for the replay.
But I'm stuck on displaying the camera feed...
I might have forgot to mention that the screen is showing what is "supposed" to be me waving my hand in front of the camera.

The colors are all wrong, and it's very grainy.

Thanks

Re: Need help with camera and screen project

Posted: Mon Jul 20, 2026 2:48 am
by nopnop2002
Is there a possibility that R and B are swapped?

Code: Select all

                uint32_t r = ((p0 >> 11) & 0x1F) + ((p1 >> 11) & 0x1F)
                           + ((p2 >> 11) & 0x1F) + ((p3 >> 11) & 0x1F);
                uint32_t g = ((p0 >> 5) & 0x3F) + ((p1 >> 5) & 0x3F)
                           + ((p2 >> 5) & 0x3F) + ((p3 >> 5) & 0x3F);
                uint32_t bl = (p0 & 0x1F) + (p1 & 0x1F)
                            + (p2 & 0x1F) + (p3 & 0x1F);