Blink test using ESP32 NodeMCU
External & Internal LED blink test Code Uploads via Arduinodroid Android app
Table of Content:
1. prerequirement
2. Internal LED blink test
3. External LED blink test
4. Summary
1. prerequirement:
Before diving into the exciting process of uploading code to your ESP32 using your Android phone, ensure you have the following:
- ESP32 NodeMCU
- LED light
- USB Cable: To connect ESP32 to device
- Arduinodroid (guide)/Arduino IDE
2. Internal LED blink test:
Internal LED blink code:
#define ONBOARD_LED 2 // internal LED pin
void setup() {
pinMode(ONBOARD_LED,OUTPUT);
}
void loop() {
delay(1000);
digitalWrite(ONBOARD_LED,HIGH);
delay(100);
digitalWrite(ONBOARD_LED,LOW);
}
- For ArduinoDroid use, refer here
- Upload code in IDE and compile it
- Now connect ESP32 NodeMCU to your device
- Upload code on ESP32
3. External LED blink test:
Connection diagram for ESP32 & LED:
Note: Make sure to connect led negative(-) to esp32 gnd(ground) and use register accordingly (without register, it will also work fine but not recommended)
External LED blink code:
#define ONBOARD_LED 19 // external LED pin
void setup() {
pinMode(ONBOARD_LED,OUTPUT);
}
void loop() {
delay(1000);
digitalWrite(ONBOARD_LED,HIGH);
delay(100);
digitalWrite(ONBOARD_LED,LOW);
}
- For ArduinoDroid use, refer here
- Upload code in IDE and compile it
- Now connect ESP32 NodeMCU to your device
- Upload code on ESP32
4. Summary:
You can experiment with code by changing time delay, pattern on turning light on/off, by adding more color light and more.
There’s nothing limited, Just think and try it.
Happy Coding!