Controlling the LED

RogerInHawaii
Posts: 21
Joined: Mon Sep 14, 2020 1:21 am

Controlling the LED

Postby RogerInHawaii » Sun Sep 27, 2020 10:07 pm

Is there a way to control the LED that's used for "flashing" when a picture is being grabbed into the Frame Buffer?

Is there a way to directly turn that LED on and off?

Is there a way to control the brightness when it's on?

Is there a way to DISABLE it so that it does not flash when a picture is being grabbed into the Frame Buffer?

ESP_Sprite
Posts: 9709
Joined: Thu Nov 26, 2015 4:08 am

Re: Controlling the LED

Postby ESP_Sprite » Mon Sep 28, 2020 8:08 am

On what hardware? In general, LEDs like that tend to be connected to a GPIO; in that case you should be able find the lines that control it in software.

xgarbxgarb
Posts: 21
Joined: Fri Jan 25, 2019 3:36 pm

Re: Controlling the LED

Postby xgarbxgarb » Fri Oct 02, 2020 5:38 pm

On the ESP32-CAM something like this should work.

Code: Select all

void setup() {
  pinMode(4, OUTPUT);// initialize io4 as an output for LED flash.
  digitalWrite(4, LOW); // flash off/
}

void smile(){
  digitalWrite(4, HIGH); // flash on
  take_photo();
  digitalWrite(4, LOW);
}
Full code is here: https://github.com/robotzero1/esp32cam- ... fieCam.ino

I'm not sure you can do PWM on that pin.

Your RGB888 tests here https://www.esp32.com/viewtopic.php?f=32&t=17479 were interesting. I learnt a lot from this thread.

Who is online

Users browsing this forum: No registered users and 6 guests