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 3030// LED FLASH setup
3131#if CONFIG_LED_ILLUMINATOR_ENABLED
3232
33- #define LED_LEDC_GPIO 22 // configure LED pin
3433#define CONFIG_LED_MAX_INTENSITY 255
3534
35+ int led_pin = 22 ; // Store the actual LED pin used
3636int led_duty = 0 ;
3737bool isStreaming = false ;
3838
@@ -97,7 +97,7 @@ void enable_led(bool en) { // Turn LED On or Off
9797 if (en && isStreaming && (led_duty > CONFIG_LED_MAX_INTENSITY)) {
9898 duty = CONFIG_LED_MAX_INTENSITY;
9999 }
100- ledcWrite (LED_LEDC_GPIO , duty);
100+ ledcWrite (led_pin , duty);
101101 // ledc_set_duty(CONFIG_LED_LEDC_SPEED_MODE, CONFIG_LED_LEDC_CHANNEL, duty);
102102 // ledc_update_duty(CONFIG_LED_LEDC_SPEED_MODE, CONFIG_LED_LEDC_CHANNEL);
103103 log_i (" Set LED intensity to %d" , duty);
@@ -845,6 +845,7 @@ void startCameraServer() {
845845
846846void setupLedFlash (int pin) {
847847#if CONFIG_LED_ILLUMINATOR_ENABLED
848+ led_pin = pin; // Store the actual LED pin used
848849 ledcAttach (pin, 5000 , 8 );
849850#else
850851 log_i (" LED flash is disabled -> CONFIG_LED_ILLUMINATOR_ENABLED = 0" );
You can’t perform that action at this time.
0 commit comments