ESP32 LED Control: Turn On/Off the Inbuilt LED|Beginner Tutorial_1
Автор: Ambabus Creations
Загружено: 2025-04-19
Просмотров: 173
In this video, you’ll learn how to enable and disable the built-in LED on your ESP32 Board using simple code. This is a perfect beginner project to get started with ESP32 and understand how digital output works.
What you'll learn:
How to control the onboard LED (usually on GPIO2 Pin)
Writing a basic sketch using digitalWrite()
Uploading the code to your Arduino board
1.Components Used:
1.1.ESP32 DEVKITE V1_1NOS
AMAZON Link: https://amzn.in/d/iZQn0gj
1.2.USB cable
AMAZON Link: https://amzn.in/d/9Pe22q8
Step 1: Install the Driode App
Go to Play Store
Search and install Driode or ArduinoDroid
Open the app
Step 2: Connect ESP32 to Your Phone
Plug your ESP32 into the USB cable
Connect that to your phone using an OTG adapter
Give USB permission when prompted
Step 3: Install Board Support (First Time Only)
In the app, go to Boards or Settings
Search and install ESP32 support
May take a few minutes the first time
Step 4: Write or Paste Code
Use this code to blink the built-in LED (usually GPIO 2):
#define LED_BUILTIN 2
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // Turn on
delay(1000);
digitalWrite(LED_BUILTIN, LOW); // Turn off
delay(1000);
}
Step 5: Compile and Upload
Click the "Verify/Compile" button
Then tap Upload
If prompted, press the BOOT button on ESP32 until upload starts
Step 6: Watch It Work!
Your ESP32’s onboard LED will now blink every second!
Disable inbuilt led
A) Upload a Code that Keeps LED OFF
Here’s a simple code that disables the built-in LED (GPIO 2) and keeps it OFF:
#define LED_BUILTIN 2
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, LOW); // Keep LED OFF
}
void loop() {
// Nothing here, LED stays OFF
}
How to Upload (Same Steps in Driode App):
1. Open the Driode App
2. Connect your ESP32 via OTG
3. Paste the code above
4. Click Compile, then Upload
5. Press the BOOT button on the ESP32 when asked
Done! The LED on your ESP32 will now remain OFF.
If you found this helpful, don’t forget to like, share, and subscribe for more Arduino tutorials!
#ESP32#Arduino #BeginnerProject #LEDControl
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: