1
1
#include " esp_camera.h"
2
2
#include < WiFi.h>
3
-
4
3
//
5
4
// WARNING!!! PSRAM IC required for UXGA resolution and high JPEG quality
6
5
// Ensure ESP32 Wrover Module or other board with PSRAM is selected
10
9
// Face Recognition is DISABLED for ESP32 and ESP32-S2, because it takes up from 15
11
10
// seconds to process single frame. Face Detection is ENABLED if PSRAM is enabled as well
12
11
13
- // ===================
14
- // Select camera model
15
- // ===================
16
- // #define CAMERA_MODEL_WROVER_KIT // Has PSRAM
17
- // #define CAMERA_MODEL_ESP_EYE // Has PSRAM
18
- // #define CAMERA_MODEL_ESP32S3_EYE // Has PSRAM
19
- // #define CAMERA_MODEL_M5STACK_PSRAM // Has PSRAM
20
- // #define CAMERA_MODEL_M5STACK_V2_PSRAM // M5Camera version B Has PSRAM
21
- // #define CAMERA_MODEL_M5STACK_WIDE // Has PSRAM
22
- // #define CAMERA_MODEL_M5STACK_ESP32CAM // No PSRAM
23
- // #define CAMERA_MODEL_M5STACK_UNITCAM // No PSRAM
24
- #define CAMERA_MODEL_AI_THINKER // Has PSRAM
25
- // #define CAMERA_MODEL_TTGO_T_JOURNAL // No PSRAM
26
- // ** Espressif Internal Boards **
27
- // #define CAMERA_MODEL_ESP32_CAM_BOARD
28
- // #define CAMERA_MODEL_ESP32S2_CAM_BOARD
29
- // #define CAMERA_MODEL_ESP32S3_CAM_LCD
30
-
12
+ #include " board.h" // Select camera model here (moved since dependencies)
31
13
#include " camera_pins.h"
32
14
15
+ #ifdef CAMERA_MODEL_AI_THINKER
16
+ #ifndef CONFIG_LED_ILLUMINATOR_ENABLED
17
+ #define CONFIG_LED_ILLUMINATOR_ENABLED 1
18
+ #endif
19
+ #include " soc/soc.h"
20
+ #include " soc/rtc_cntl_reg.h"
21
+ #endif
22
+
23
+ #if defined(CONFIG_LED_ILLUMINATOR_ENABLED)
24
+ void ledc_setup ();
25
+ #endif
26
+
33
27
// ===========================
34
28
// Enter your WiFi credentials
35
29
// ===========================
@@ -43,6 +37,10 @@ void setup() {
43
37
Serial.setDebugOutput (true );
44
38
Serial.println ();
45
39
40
+ #ifdef CAMERA_MODEL_AI_THINKER
41
+ WRITE_PERI_REG (RTC_CNTL_BROWN_OUT_REG, 0 ); // disable brownout detector
42
+ #endif
43
+
46
44
camera_config_t config;
47
45
config.ledc_channel = LEDC_CHANNEL_0;
48
46
config.ledc_timer = LEDC_TIMER_0;
@@ -139,6 +137,10 @@ void setup() {
139
137
Serial.print (" Camera Ready! Use 'http://" );
140
138
Serial.print (WiFi.localIP ());
141
139
Serial.println (" ' to connect" );
140
+
141
+ #if defined(CONFIG_LED_ILLUMINATOR_ENABLED)
142
+ ledc_setup ();
143
+ #endif
142
144
}
143
145
144
146
void loop () {
0 commit comments