Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit04bac55

Browse files
committed
fix: led flash not working if not using default model.
1 parent422e526 commit04bac55

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎libraries/ESP32/examples/Camera/CameraWebServer/app_httpd.cpp‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
// LED FLASH setup
3131
#if CONFIG_LED_ILLUMINATOR_ENABLED
3232

33-
#defineLED_LEDC_GPIO22//configure LED pin
3433
#defineCONFIG_LED_MAX_INTENSITY255
3534

35+
int led_pin =22;// Store the actual LED pin used
3636
int led_duty =0;
3737
bool 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

846846
voidsetupLedFlash(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");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp