Hello
I'm using a ESP32 CAM that has a Led-flash included. I initialize the led in the program and it works ok. But if I call ESP.restart() or after a sleep wake up and the ledc is always of.
I don't know what to do.
Thanks for any help
ledc doesn't work after restart or deep sleep wakeup
Re: ledc doesn't work after restart or deep sleep wakeup
I forgot to send the code:
Before setup:
into setup():
into loop():
Before setup:
Code: Select all
#define ledFlash 4
Code: Select all
ledcSetup(LEDC_CHANNEL_7, 12000, 9);
ledcAttachPin(ledFlash, LEDC_CHANNEL_7);
ledcWrite(LEDC_CHANNEL_7, 0);
Code: Select all
ledcWrite(LEDC_CHANNEL_7, 50);
Re: ledc doesn't work after restart or deep sleep wakeup
Solution found
I have seen that before to enter to sleep mode I used the instruction:
This block this GPIO to prevent any changes in this pin.
After restart, the chip must execute the instruction:
to unblock it.
I have seen that before to enter to sleep mode I used the instruction:
Code: Select all
rtc_gpio_hold_en(GPIO_NUM_4);
After restart, the chip must execute the instruction:
Code: Select all
rtc_gpio_hold_dis(GPIO_NUM_4);
Who is online
Users browsing this forum: No registered users and 75 guests