File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
libraries/ESP32/examples/Camera/CameraWebServer Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 30
30
// LED FLASH setup
31
31
#if CONFIG_LED_ILLUMINATOR_ENABLED
32
32
33
- #define LED_LEDC_GPIO 22 // configure LED pin
34
33
#define CONFIG_LED_MAX_INTENSITY 255
35
34
35
+ int led_pin = 22 ; // Store the actual LED pin used
36
36
int led_duty = 0 ;
37
37
bool isStreaming = false ;
38
38
@@ -97,7 +97,7 @@ void enable_led(bool en) { // Turn LED On or Off
97
97
if (en && isStreaming && (led_duty > CONFIG_LED_MAX_INTENSITY)) {
98
98
duty = CONFIG_LED_MAX_INTENSITY;
99
99
}
100
- ledcWrite (LED_LEDC_GPIO , duty);
100
+ ledcWrite (led_pin , duty);
101
101
// ledc_set_duty(CONFIG_LED_LEDC_SPEED_MODE, CONFIG_LED_LEDC_CHANNEL, duty);
102
102
// ledc_update_duty(CONFIG_LED_LEDC_SPEED_MODE, CONFIG_LED_LEDC_CHANNEL);
103
103
log_i (" Set LED intensity to %d" , duty);
@@ -845,6 +845,7 @@ void startCameraServer() {
845
845
846
846
void setupLedFlash (int pin) {
847
847
#if CONFIG_LED_ILLUMINATOR_ENABLED
848
+ led_pin = pin; // Store the actual LED pin used
848
849
ledcAttach (pin, 5000 , 8 );
849
850
#else
850
851
log_i (" LED flash is disabled -> CONFIG_LED_ILLUMINATOR_ENABLED = 0" );
You can’t perform that action at this time.
0 commit comments