Blinking an LED With ESP32

4,767

7

4

Posted

Introduction: Blinking an LED With ESP32

The ESP32 is an advanced IoT microcontroller board possessing WiFi and Bluetooth Low Energy capabilities, as well as limited compatibility with the Arduino Core. This is the first module in a series of tutorials regarding the use of the ESP32 Development Board, from it's equivalent Arduino projects to advanced IoT projects.

The 'Blinking an LED' project uses the ESP32 Development Board will be used to blink an LED at a specific timed interval, infinitely. It is the essential fundamental tutorial for any microcontroller board, as it is the hardware equivalent of the classic "Hello World" tutorial!!!

Step 1: Tools and Materials

  • ESP32 Development Board
  • 5mm LED
  • 100Ω Resistor
  • 3 pieces of jumper wires
  • Breadboard

Step 2: Circuitry

  • Connect the negative pin (cathode) of the LED, indicated as the flat edge of the LED to ground, shown as the blue wire.
  • Connect the positive pin (anode) of the LED, indicated as the rounded edge of the LED to a 100Ω resistor.
  • Connect the free end of the resistor to pin D5 on the ESP32, shown as the red wire.

Step 3: Coding

/***
 * LED Blinking
 * Code Written by TechMartian
 */
const int ledPin = 5;
void setup() {
  // setup pin 5 as a digital output pin
  pinMode (ledPin, OUTPUT);
}
void loop() {
  digitalWrite (ledPin, HIGH);	// turn on the LED
  delay(500);	// wait for half a second or 500 milliseconds
  digitalWrite (ledPin, LOW);	// turn off the LED
  delay(500);	// wait for half a second or 500 milliseconds
}

Share

  • Just got ESP32 today...-ake117

    ake117 made it!

Recommendations

  • Epilog Challenge 9

    Epilog Challenge 9
  • Sew Warm Contest 2018

    Sew Warm Contest 2018
  • Minecraft Challenge 2018

    Minecraft Challenge 2018
user

We have a be nice policy.
Please be positive and constructive.

Tips

Questions

Comments

Wrong resistor value, preferred output is 6mA only.