Using ESP32-CAM LED Flash

The ESP32-CAM module is equipped with a bright LED. Here are some notes on it and program to control it, blinking it(see the tutorial ESP32-CAM LED Blink Tutorial). Also many ask whether GPIO 4 pin of ESP32-CAM is the the bright LED on the ESP32-CAM board? and whether this is also the led bulletin? Here is the answer. 

No, the GPIO 4 on the ESP32-CAM is not the bright LED (the flash LED) on the board. The bright LED used as a flash for the camera is connected to GPIO 4, but it is not considered the LED built-in. C

For the onboard LED that you might expect as an "LED_BUILTIN" (often referred to as an indicator LED on other boards), the ESP32-CAM does not have one in the typical sense. However, the bright LED (flash) can be controlled as an onboard LED. To control this LED, you can use GPIO 4.

ESP32-CAM LED Flash Blink
 

Here’s how you can blink the bright LED on the ESP32-CAM:

#define FLASH_LED_PIN 4  // The bright LED is connected to GPIO 4

void setup() {
  // Initialize the LED pin as an output
  pinMode(FLASH_LED_PIN, OUTPUT);
}

void loop() {
  // Turn the LED on (HIGH is the voltage level)
  digitalWrite(FLASH_LED_PIN, HIGH);
  // Wait for 500 milliseconds
  delay(500);
  // Turn the LED off by making the voltage LOW
  digitalWrite(FLASH_LED_PIN, LOW);
  // Wait for 500 milliseconds
  delay(500);
}

Post a Comment

Previous Post Next Post