From 5443d7ca933ccee850f75db6d5ce11c5ae57d09a Mon Sep 17 00:00:00 2001 From: WizardTim <43670403+WizardTim@users.noreply.github.com> Date: Mon, 20 Jan 2020 23:33:38 +1000 Subject: [PATCH] Add TTGO T Journal Camera module & improve commenting (#3515) Added pinout for TTGO T Journal device and improved the intent of comments. --- .../CameraWebServer/CameraWebServer.ino | 30 +++++++++++-------- .../Camera/CameraWebServer/camera_pins.h | 19 ++++++++++++ 2 files changed, 36 insertions(+), 13 deletions(-) diff --git a/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino b/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino index 445797d5..46df26a1 100644 --- a/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino +++ b/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino @@ -2,16 +2,18 @@ #include // -// WARNING!!! Make sure that you have either selected ESP32 Wrover Module, -// or another board which has PSRAM enabled +// WARNING!!! PSRAM IC required for UXGA resolution and high JPEG quality +// Ensure ESP32 Wrover Module or other board with PSRAM is selected +// Partial images will be transmitted if image exceeds buffer size // // Select camera model -#define CAMERA_MODEL_WROVER_KIT -//#define CAMERA_MODEL_ESP_EYE -//#define CAMERA_MODEL_M5STACK_PSRAM -//#define CAMERA_MODEL_M5STACK_WIDE -//#define CAMERA_MODEL_AI_THINKER +#define CAMERA_MODEL_WROVER_KIT // Has PSRAM +//#define CAMERA_MODEL_ESP_EYE // Has PSRAM +//#define CAMERA_MODEL_M5STACK_PSRAM // Has PSRAM +//#define CAMERA_MODEL_M5STACK_WIDE // Has PSRAM +//#define CAMERA_MODEL_AI_THINKER // Has PSRAM +//#define CAMERA_MODEL_TTGO_T_JOURNAL // No PSRAM #include "camera_pins.h" @@ -46,7 +48,9 @@ void setup() { config.pin_reset = RESET_GPIO_NUM; config.xclk_freq_hz = 20000000; config.pixel_format = PIXFORMAT_JPEG; - //init with high specs to pre-allocate larger buffers + + // if PSRAM IC present, init with UXGA resolution and higher JPEG quality + // for larger pre-allocated frame buffer. if(psramFound()){ config.frame_size = FRAMESIZE_UXGA; config.jpeg_quality = 10; @@ -70,13 +74,13 @@ void setup() { } sensor_t * s = esp_camera_sensor_get(); - //initial sensors are flipped vertically and colors are a bit saturated + // initial sensors are flipped vertically and colors are a bit saturated if (s->id.PID == OV3660_PID) { - s->set_vflip(s, 1);//flip it back - s->set_brightness(s, 1);//up the blightness just a bit - s->set_saturation(s, -2);//lower the saturation + s->set_vflip(s, 1); // flip it back + s->set_brightness(s, 1); // up the brightness just a bit + s->set_saturation(s, -2); // lower the saturation } - //drop down frame size for higher initial frame rate + // drop down frame size for higher initial frame rate s->set_framesize(s, FRAMESIZE_QVGA); #if defined(CAMERA_MODEL_M5STACK_WIDE) diff --git a/libraries/ESP32/examples/Camera/CameraWebServer/camera_pins.h b/libraries/ESP32/examples/Camera/CameraWebServer/camera_pins.h index 7855722a..e65bc6b1 100644 --- a/libraries/ESP32/examples/Camera/CameraWebServer/camera_pins.h +++ b/libraries/ESP32/examples/Camera/CameraWebServer/camera_pins.h @@ -94,6 +94,25 @@ #define HREF_GPIO_NUM 23 #define PCLK_GPIO_NUM 22 +#elif defined(CAMERA_MODEL_TTGO_T_JOURNAL) +#define PWDN_GPIO_NUM 0 +#define RESET_GPIO_NUM 15 +#define XCLK_GPIO_NUM 27 +#define SIOD_GPIO_NUM 25 +#define SIOC_GPIO_NUM 23 + +#define Y9_GPIO_NUM 19 +#define Y8_GPIO_NUM 36 +#define Y7_GPIO_NUM 18 +#define Y6_GPIO_NUM 39 +#define Y5_GPIO_NUM 5 +#define Y4_GPIO_NUM 34 +#define Y3_GPIO_NUM 35 +#define Y2_GPIO_NUM 17 +#define VSYNC_GPIO_NUM 22 +#define HREF_GPIO_NUM 26 +#define PCLK_GPIO_NUM 21 + #else #error "Camera model not selected" #endif