0% found this document useful (0 votes)
80 views

ESP32 GPIO Tutorial Using ESP-IDF - LED Blinking Example

Uploaded by

xpologyworld
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
80 views

ESP32 GPIO Tutorial Using ESP-IDF - LED Blinking Example

Uploaded by

xpologyworld
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

31.10.

2024 15:59 ESP32 GPIO Tutorial Using ESP-IDF | LED Blinking Example

 Menu 

Home → Tutorials → Wireless → ESP32 → IDF → ESP32 GPIO Tutorial Using ESP-IDF – LED
Blinking and Push Button Example

Table of Contents

ESP32 GPIO Tutorial Using ESP-IDF – LED


Blinking and Push Button Example
by Admin esp32 , FreeRTOS , GPIO , LED Interfacing , RTOS , Tutorials IDF

https://embetronicx.com/tutorials/wireless/esp32/idf/esp32-gpio-tutorial-using-esp-idf/ 1/28
31.10.2024 15:59 ESP32 GPIO Tutorial Using ESP-IDF | LED Blinking Example

This article is the continuation of the Series on the ESP32 Tutorials using ESP-IDF and carries the

discussion on the ESP32 and its peripherals. The aim of this series is to provide easy and practical
examples that anyone can understand. In our previous post, we have seen how to setup the Visual

Studio Code for ESP-IDF and executed the hello world program. In this post, we will see ESP32
Table of Contents

GPIO tutorial using ESP-IDF.

Please read the GPIO article which explains how the GPIO works in all microcontroller and types of

the GPIO.

Table of Contents
1. Hardware Required
2. Introduction
3. ESP32 30 Pin Development board Pinout
4. ESP32 38 Pin Development board Pinout
5. ESP32 Pins
6. ESP32 GPIO Registers
7. ESP32 GPIO Driver APIs
8. LED Interfacing
8.1. Connection
8.2. Source Code – ESP32 GPIO Example (Blinky)
8.3. Demo – ESP32 GPIO Example (Blinky)
9. Push Button Interfacing – Without Interrupt
9.1. Connection
9.2. Source Code – ESP32 GPIO Input
9.3. Demo – ESP32 GPIO Input

https://embetronicx.com/tutorials/wireless/esp32/idf/esp32-gpio-tutorial-using-esp-idf/ 2/28
31.10.2024 15:59 ESP32 GPIO Tutorial Using ESP-IDF | LED Blinking Example

10. Push Button Interfacing – Using Interrupt


10.1. Connection
10.2. Source Code – ESP32 GPIO Interrupt Example
10.3. Demo – ESP32 GPIO Interrupt Example
10.4. Discover more from EmbeTronicX

Hardware Required

PC
ESP32 Board

LED
Resistor (To limit the current through the LED)

Connecting wires
Bread Board

Introduction

The ESP32 is a versatile microcontroller that is widely used in the field of embedded system and IoT

(Internet of Things). ESP32 has 48 pins which can do multiple functions. But not all the pins are
Table of Contents

exposed in the development board. Few pins cannot be used also. There are multiple ESP32

development boards are available in the marker including cloned boards.

In this series, we are going to use two ESP32 development boards which are 30 pin board and 38
pin board.

Before looking into the GPIO, we will see the pinout of the ESP32.

https://embetronicx.com/tutorials/wireless/esp32/idf/esp32-gpio-tutorial-using-esp-idf/ 3/28
31.10.2024 15:59 ESP32 GPIO Tutorial Using ESP-IDF | LED Blinking Example

Tesa Powerstrips Askı Küçük Oval


Kendinden Yapışkanlı, Çıkarılabilir, beyaz

154 80 TL

ESP32 30 Pin Development board Pinout

The below image illustrates the ESP-WROOM-32 chip pinout of 30 Pin ESP32 Development board.


Table of Contents

ESP32 38 Pin Development board Pinout

The below image illustrates the ESP-WROOM-32 chip pinout of 38 Pin ESP32 Development board.

https://embetronicx.com/tutorials/wireless/esp32/idf/esp32-gpio-tutorial-using-esp-idf/ 4/28
31.10.2024 15:59 ESP32 GPIO Tutorial Using ESP-IDF | LED Blinking Example

ESP32 Pins

ESP32 pins are used for multiple functions. Those pin supports the below functionalities.

Table of Contents

18 Analog-to-Digital Converter (ADC) channels


3 SPI interfaces
3 UART interfaces

2 I2C interfaces
16 PWM output channels
2 Digital-to-Analog Converters (DAC)
2 I2S interfaces

10 Capacitive sensing GPIO’s

In this tutorial, we are going to see on the GPIO functionality. We will see other functionalities later
part of this ESP32 tutorial series. The ESP32 chip features 34 physical GPIO pins (GPIO0 ~

GPIO19, GPIO21 ~ GPIO23, GPIO25 ~ GPIO27, and GPIO32 ~ GPIO39). Each pin can be used as
a general-purpose I/O, or be connected to an internal peripheral signal.

GPIO34 to GPIO39 are only input pins and it won’t support output. These pins don’t have internal

pull-ups or pull-down resistors. So we can use these pins only as inputs.

https://embetronicx.com/tutorials/wireless/esp32/idf/esp32-gpio-tutorial-using-esp-idf/ 5/28
31.10.2024 15:59 ESP32 GPIO Tutorial Using ESP-IDF | LED Blinking Example

16,50 ₺
KEŞFET

Tesa Powerstrips Askı Küçük Oval


Kendinden Yapışkanlı, Çıkarılabilir, beyaz
16,50 ₺
1 405,15 ₺
154 80 TL HEMEN KEŞFET KEŞFET

The table below provides more information on pin usage, and please note the comments in the table
for GPIOs with restrictions.

GPIO Analog Function RTC GPIO Comments

GPIO0 ADC2_CH1 RTC_GPIO11 Strapping pin


GPIO1 TXD
Table of Contents

GPIO2 ADC2_CH2 RTC_GPIO12 Strapping pin

GPIO3 RXD

GPIO4 ADC2_CH0 RTC_GPIO10

GPIO5 Strapping pin

GPIO6 SPI0/1

GPIO7 SPI0/1

GPIO8 SPI0/1

GPIO9 SPI0/1

GPIO10 SPI0/1

GPIO11 SPI0/1

https://embetronicx.com/tutorials/wireless/esp32/idf/esp32-gpio-tutorial-using-esp-idf/ 6/28
31.10.2024 15:59 ESP32 GPIO Tutorial Using ESP-IDF | LED Blinking Example

GPIO Analog Function RTC GPIO Comments

GPIO12 ADC2_CH5 RTC_GPIO15 Strapping pin; JTAG

GPIO13 ADC2_CH4 RTC_GPIO14 JTAG

GPIO14 ADC2_CH6 RTC_GPIO16 JTAG

GPIO15 ADC2_CH3 RTC_GPIO13 Strapping pin; JTAG

GPIO16 SPI0/1

GPIO17 SPI0/1

GPIO18

GPIO19

GPIO21


GPIO22
Table of Contents

GPIO23

GPIO25 ADC2_CH8 RTC_GPIO6

GPIO26 ADC2_CH9 RTC_GPIO7

GPIO27 ADC2_CH7 RTC_GPIO17

GPIO32 ADC1_CH4 RTC_GPIO9

GPIO33 ADC1_CH5 RTC_GPIO8

GPIO34 ADC1_CH6 RTC_GPIO4 GPI

GPIO35 ADC1_CH7 RTC_GPIO5 GPI

GPIO36 ADC1_CH0 RTC_GPIO0 GPI

GPIO37 ADC1_CH1 RTC_GPIO1 GPI

https://embetronicx.com/tutorials/wireless/esp32/idf/esp32-gpio-tutorial-using-esp-idf/ 7/28
31.10.2024 15:59 ESP32 GPIO Tutorial Using ESP-IDF | LED Blinking Example

Note: While booting we need to keep the below GPIOs in respective states. These pins are
GPIO Analog Function RTC GPIO Comments
called as strapping pins.
GPIO38 ADC1_CH2 RTC_GPIO2 GPI
GPIO 0
GPIO39 ADC1_CH3 RTC_GPIO3 GPI
GPIO 2
GPIO 4
GPIO 5 (must be HIGH during boot)
GPIO 12 (must be LOW during boot)
GPIO 15 (must be HIGH during boot)

These are used to put the ESP32 into bootloader or flashing mode. On most development boards
with built-in USB/Serial, you don’t need to worry about the state of these pins. The board puts the

pins in the right state for flashing or boot mode.

However, if you have peripherals connected to those pins, you may have trouble trying to upload
new code, flashing the ESP32 with new firmware or resetting the board. If you have some

peripherals connected to the strapping pins, and you are getting trouble uploading code or flashing
Table of Contents

the ESP32, it may be because those peripherals are preventing the ESP32 to enter the right mode.
After resetting, flashing, or booting, those pins work as expected.

ESP32 GPIO Registers

In ESP32, GPIO registers are memory-mapped registers that control the behavior of each GPIO pin.
But when we use the ESP-IDF, we no need to bother about the registers. Because, it has GPIO
driver. So, we can use that GPIO driver APIs in our code.

https://embetronicx.com/tutorials/wireless/esp32/idf/esp32-gpio-tutorial-using-esp-idf/ 8/28
31.10.2024 15:59 ESP32 GPIO Tutorial Using ESP-IDF | LED Blinking Example

ESP32 GPIO Driver APIs

ESP-IDF GPIO driver has few APIs to control the GPIO functionalities. We will see few important
APIs.

API Details

This function configures the GPIO


gpio_config(const gpio_config_t *pGPIOConfig) Mode(output/Input), Pull-up, Pull-down,
Interrupt type

This function reset the GPIO pin to


gpio_reset_pin(gpio_num_t gpio_num)
default state.

gpio_set_direction(gpio_num_t gpio_num, This function sets the GPIO direction


gpio_mode_t mode) (Input or Output).

Table of Contents

gpio_set_level(gpio_num_t gpio_num, uint32_t This function set the GPIO state to high
level) or Low.

This function returns the GPIO state


int gpio_get_level(gpio_num_t gpio_num)
(High or Low).

This function enables the pullup resistor


gpio_pullup_en(gpio_num_t gpio_num)
for the GPIO.

This function disables the pullup


gpio_pullup_dis(gpio_num_t gpio_num)
resistor for the GPIO.

This function enables the pulldown


gpio_pulldown_en(gpio_num_t gpio_num)
resistor for the GPIO.

This function disables the pulldown


gpio_pulldown_dis(gpio_num_t gpio_num)
resistor for the GPIO.

https://embetronicx.com/tutorials/wireless/esp32/idf/esp32-gpio-tutorial-using-esp-idf/ 9/28
31.10.2024 15:59 ESP32 GPIO Tutorial Using ESP-IDF | LED Blinking Example

This function set the interrupt trigger


gpio_set_intr_type(gpio_num_t gpio_num,
type (Raising edge, Falling edge, Level,
gpio_int_type_t intr_type)
Any edge, etc).

This function enables the interrupt for


gpio_intr_enable(gpio_num_t gpio_num)
the given GPIO.

This function disables the interrupt for


gpio_intr_disable(gpio_num_t gpio_num)
the given GPIO.

This function Install the GPIO driver’s


ETS_GPIO_INTR_SOURCE ISR
gpio_install_isr_service(int intr_alloc_flags)
handler service, which allows per-pin
GPIO interrupt handlers.

This function Uninstall the driver’s GPIO


gpio_uninstall_isr_service(void)
ISR service, freeing related resources.

Table of Contents

gpio_isr_handler_add(gpio_num_t gpio_num, This function Adds ISR handler for the


gpio_isr_t isr_handler, void *args) corresponding GPIO pin.

This function Removes ISR handler for


gpio_isr_handler_remove(gpio_num_t gpio_num)
the corresponding GPIO pin.

LED Interfacing

LED interfacing with ESP32 involves connecting an LED to one of the GPIO pins of the ESP32 and
controlling its state (on/off) through code. In this demo, we are going to use two GPIOs (GPIO2
which is connected to on board LED and GPIO25).

Connection

Connect the anode (+) as positive to the LED to a GPIO 2 pin on the ESP32.
Connect the cathode (-) as negative to the starting point of the resistor.

https://embetronicx.com/tutorials/wireless/esp32/idf/esp32-gpio-tutorial-using-esp-idf/ 10/28
31.10.2024 15:59 ESP32 GPIO Tutorial Using ESP-IDF | LED Blinking Example

Source Code – ESP32 GPIO Example (Blinky)



Table of Contents

Create the empty project and copy paste the below code to the main.c.

[Please download the complete project from GitHub]

1. #include <stdio.h>
2. #include "freertos/FreeRTOS.h"
3. #include "freertos/task.h"
4. #include "driver/gpio.h"
5. #include "esp_log.h"
6. #include "sdkconfig.h"
7.
8. static const char *TAG = "ETX_BLINKY";
9.
10. #define BLINK_GPIO_1 2
11. #define BLINK_GPIO_2 25
12.
13. void app_main(void)
14. {
15. /* Reset the pin */
16. gpio_reset_pin(BLINK_GPIO_1);
17. gpio_reset_pin(BLINK_GPIO_2);
18.
19. /* Set the GPIOs to Output mode */
20. gpio_set_direction(BLINK_GPIO_1, GPIO_MODE_OUTPUT);
21. gpio_set_direction(BLINK_GPIO_2, GPIO_MODE_OUTPUT);
22.
23. while (1)
https://embetronicx.com/tutorials/wireless/esp32/idf/esp32-gpio-tutorial-using-esp-idf/ 11/28
31.10.2024 15:59 ESP32 GPIO Tutorial Using ESP-IDF | LED Blinking Example
24. {
25. gpio_set_level(BLINK_GPIO_1, 1);
26. gpio_set_level(BLINK_GPIO_2, 1);
27. vTaskDelay(1000 / portTICK_PERIOD_MS);
28. ESP_LOGI(TAG, "Turning the LED %s!","ON");
29.
30. gpio_set_level(BLINK_GPIO_1, 0);
31. gpio_set_level(BLINK_GPIO_2, 0);
32. vTaskDelay(1000 / portTICK_PERIOD_MS);
33. ESP_LOGI(TAG, "Turning the LED %s!","OFF");
34. }
35. }

Overall, this code initializes a GPIO pin on the ESP32, configures it as an output, and then enters an
infinite loop, continuously turning an LED connected to GPIO pin ON and OFF with a 1000-mili
second delay. Log messages are printed to indicate the state of the LED.


Table of Contents

Ad Ad

Demo – ESP32 GPIO Example (Blinky)

The below image shows the output the above code.

https://embetronicx.com/tutorials/wireless/esp32/idf/esp32-gpio-tutorial-using-esp-idf/ 12/28
31.10.2024 15:59 ESP32 GPIO Tutorial Using ESP-IDF | LED Blinking Example

Push Button Interfacing – Without Interrupt



Table of Contents

In this example we are going to set one GPIO (GPIO25) as a input and another GPIO (GPIO2) as a
output. When we press the button, the LED will be ON and when we release the button, the LED will
be OFF.

Connection

Connect the one end of the push button to GPIO25 and another end of the push button to
GND.
Connect the LED to GPIO2.

Source Code – ESP32 GPIO Input

Create the empty project and copy paste the below code to the main.c.

[Please download the complete project from GitHub]

1. #include <stdio.h>
2. #include "freertos/FreeRTOS.h"
3. #include "freertos/task.h"
4. #include "driver/gpio.h"
5. #include "esp_log.h"
6. #include "sdkconfig.h"
https://embetronicx.com/tutorials/wireless/esp32/idf/esp32-gpio-tutorial-using-esp-idf/ 13/28
31.10.2024 15:59 ESP32 GPIO Tutorial Using ESP-IDF | LED Blinking Example
7.
8. static const char *TAG = "ETX_PUSH_BUTTON";
9.
10. #define BLINK_GPIO_1 2
11. #define BLINK_GPIO_2 25
12.
13. void app_main(void)
14. {
15. /* Reset the pin */
16. gpio_reset_pin(BLINK_GPIO_1);
17. gpio_reset_pin(BLINK_GPIO_2);
18.
19. /* Set the GPIOs to Output mode */
20. gpio_set_direction(BLINK_GPIO_1, GPIO_MODE_OUTPUT);
21. gpio_set_direction(BLINK_GPIO_2, GPIO_MODE_INPUT);
22.
23. /* Enable Pullup for Input Pin */
24. gpio_pullup_en(BLINK_GPIO_2);
25.
26. while (1)
27. {
28. if( gpio_get_level(BLINK_GPIO_2) == 0 )
29. {
30. /* Button is pressed. Turn on the LED */
31. gpio_set_level(BLINK_GPIO_1, 1);
32. ESP_LOGI(TAG, "Turning the LED %s!","ON");
33. }
→ 34. else
Table of Contents

35. {
36. /* Button is released. Turn off the LED */
37. gpio_set_level(BLINK_GPIO_1, 0);
38. }
39. }
40. }

Demo – ESP32 GPIO Input

The below image shows the output the above code.

Ad Ad

https://embetronicx.com/tutorials/wireless/esp32/idf/esp32-gpio-tutorial-using-esp-idf/ 14/28
31.10.2024 15:59 ESP32 GPIO Tutorial Using ESP-IDF | LED Blinking Example

Push Button Interfacing – Using Interrupt



Connection
Table of Contents

Connect the one end of the push button to GPIO25 and another end of the push button to
GND.
Connect the LED to GPIO2.

Source Code – ESP32 GPIO Interrupt Example

Create the empty project and copy paste the below code to the main.c. The below code toggles the
LED with the each button press.

[Please download the complete project from GitHub]

1. #include <stdio.h>
2. #include "freertos/FreeRTOS.h"
3. #include "freertos/task.h"
4. #include "driver/gpio.h"
5. #include "esp_log.h"
6. #include "sdkconfig.h"
7. #include <inttypes.h>
8.
9. #define BLINK_GPIO_1 2
10. #define BLINK_GPIO_2 25
11.

https://embetronicx.com/tutorials/wireless/esp32/idf/esp32-gpio-tutorial-using-esp-idf/ 15/28
31.10.2024 15:59 ESP32 GPIO Tutorial Using ESP-IDF | LED Blinking Example
12. bool gpio_value = false;
13.
14. static void IRAM_ATTR gpio_isr_handler(void* arg)
15. {
16. /*
17. TODO - Implement the debouncing algorithm
18. to eliminate the Spurious interrupt trigger.
19. */
20.
21. /* Disable the Interrupt */
22. gpio_intr_disable(BLINK_GPIO_2);
23. gpio_isr_handler_remove(BLINK_GPIO_2);
24.
25. /* Button is pressed. Toggle the LED */
26. gpio_set_level(BLINK_GPIO_1, gpio_value);
27. gpio_value = !gpio_value;
28.
29. /* Re-Enable the Interrupt */
30. gpio_isr_handler_add(BLINK_GPIO_2, gpio_isr_handler, NULL);
31. gpio_intr_enable(BLINK_GPIO_2);
32. }
33.
34. void app_main(void)
35. {
36. /* Reset the pin */
37. gpio_reset_pin(BLINK_GPIO_1);
38. gpio_reset_pin(BLINK_GPIO_2);
→ 39.
Table of Contents

40. /* Set the GPIOs to Output mode */


41. gpio_set_direction(BLINK_GPIO_1, GPIO_MODE_OUTPUT);
42. gpio_set_direction(BLINK_GPIO_2, GPIO_MODE_INPUT);
43.
44. /* Enable Pullup for Input Pin */
45. gpio_pullup_en(BLINK_GPIO_2);
46.
47. /* Disable pulldown for Input Pin */
48. gpio_pulldown_dis(BLINK_GPIO_2);
49.
50. /* Configure Raising Edge detection Interrupt for Input Pin */
51. gpio_set_intr_type(BLINK_GPIO_2, GPIO_INTR_POSEDGE);
52.
53. /* install gpio isr service to default values */
54. gpio_install_isr_service(0);
55.
56. /* Attach the ISR to the GPIO interrupt */
57. gpio_isr_handler_add(BLINK_GPIO_2, gpio_isr_handler, NULL);
58.
59. /* Enable the Interrupt */
60. gpio_intr_enable(BLINK_GPIO_2);
61.
62. while (1)
63. {
64. /* infinite loop */
65. }
66. }

Demo – ESP32 GPIO Interrupt Example


https://embetronicx.com/tutorials/wireless/esp32/idf/esp32-gpio-tutorial-using-esp-idf/ 16/28
31.10.2024 15:59 ESP32 GPIO Tutorial Using ESP-IDF | LED Blinking Example

The below image shows the output the above code.


Table of Contents

In our next article, we will see ESP32 UART Communication tutorial.

You can also read the below tutorials.

Ad Ad

https://embetronicx.com/tutorials/wireless/esp32/idf/esp32-gpio-tutorial-using-esp-idf/ 17/28
31.10.2024 15:59 ESP32 GPIO Tutorial Using ESP-IDF | LED Blinking Example

Linux Device Driver Tutorials C Programming Tutorials

FreeRTOS Tutorials NuttX RTOS Tutorials

RTX RTOS Tutorials Interrupts Basics

I2C Protocol – Part 1 (Basics) I2C Protocol – Part 2 (Advanced Topics)

STM32 Tutorials LPC2148 (ARM7) Tutorials

PIC16F877A Tutorials 8051 Tutorials

Unit Testing in C Tutorials ESP32-IDF Tutorials

Raspberry Pi Tutorials Embedded Interview Topics

Reset Sequence in ARM Cortex-M4 BLE Basics

VIC and NVIC in ARM SPI – Serial Peripheral Interface Protocol

STM32F7 Bootloader Tutorials Raspberry PI Pico Tutorials


STM32F103 Bootloader Tutorials RT-Thread RTOS Tutorials
Table of Contents

Zephyr RTOS Tutorials – STM32 Zephyr RTOS Tutorials – ESP32

AUTOSAR Tutorials UDS Protocol Tutorials

Product Reviews STM32 MikroC Bootloader Tutorial

VHDL Tutorials

Admin
Embedded Software | Firmware | Linux Devic Deriver | RTOS

Hi, I am a tech blogger and an Embedded Engineer. I am always eager to learn and
explore tech-related concepts. And also, I wanted to share my knowledge with
everyone in a more straightforward way with easy practical examples. I strongly
believe that learning by doing is more powerful than just learning by reading. I love to do experiments. If
you want to help or support me on my journey, consider sharing my articles, or Buy me a Coffee! Thank
you for reading my blog! Happy learning!

https://embetronicx.com/tutorials/wireless/esp32/idf/esp32-gpio-tutorial-using-esp-idf/ 18/28
31.10.2024 15:59 ESP32 GPIO Tutorial Using ESP-IDF | LED Blinking Example

Hits (since 1 July 2022) - 18,960

Discover more from EmbeTronicX


Subscribe to get the latest posts sent to your email.

Type your email… Subscribe

 IDF

 esp32 , FreeRTOS , GPIO , LED Interfacing , RTOS , Tutorials

 Why Medical Devices Need Effective Test And Measurements


 HQ NextPCB Introduces New PCB Gerber Viewer: HQDFM Online Lite Edition


Leave a Comment
Table of Contents

Name *

Email *

Website

Notify me of follow-up comments by email.

Notify me of new posts by email.

https://embetronicx.com/tutorials/wireless/esp32/idf/esp32-gpio-tutorial-using-esp-idf/ 19/28
31.10.2024 15:59 ESP32 GPIO Tutorial Using ESP-IDF | LED Blinking Example

Post Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.


Table of Contents

Browse by Tags
8051 (33) ADC (7) Automotive (9) Bootloader (10) Bottom Half (12) c (49)

Character Device Driver (50) Cortex-M0+ (16) Cortex-M3 (19) cortex-m4 (38) Cortex-M7 (32)

CubeIDE (7) DC Motor (8) Device Driver (53) Diagnostics (6) esp32 (12) FreeRTOS (15)

GPIO (26) GSM (7) HAL (7) I2C (14) Interrupts (18) keypad (6) LCD Interfacing (51)

LED Interfacing (29) Linux (53) LPC2148 (41) NuttX RTOS (7) PIC16F877A (26) Raspberry PI (15)

RT-Thread RTOS (9) RTOS (34) Sensor (24) SPI (9) ST Link (8) stm32 (38) sysfs (10)

Tasklet (6) Timer/Counter (8) Tutorials (262) UART (37) UDS Protocol (6) USB (6)

Vilambaram (42) Workqueue (6)

https://embetronicx.com/tutorials/wireless/esp32/idf/esp32-gpio-tutorial-using-esp-idf/ 20/28
31.10.2024 15:59 ESP32 GPIO Tutorial Using ESP-IDF | LED Blinking Example

Recent Posts
How to Select the Right Electrical Contactor for Your Needs

How can open-source communities boost your programming skills as a student?

What To Do If Laptop Accepts Only Ethernet And No Wi-Fi

Get Your First PCB Prototype for Only $1 with ALLPCB

The Social Implications of Gambling in Indian Society: Pin-Up’s Perspective

Subscribe to the Blog via Email


Enter your email address to receive the notifications of new posts.

Email Address

Subscribe

Join 365 other subscribers


→ Wanna Disable Ads in EmbeTronicX?
Table of Contents

Be a premium member!!! Register

Premium members, Please Login

[75% OFF ] Use code – ETX75

One Month – 4 USD (Rs.320) 1 USD (Rs.80)

One Year – 40 USD (Rs.3200) 10 USD (Rs.800)

If you want to appreciate EmbeTronicX, You

Should Consider:

Buy me a Hardware or Coffee 22

https://embetronicx.com/tutorials/wireless/esp32/idf/esp32-gpio-tutorial-using-esp-idf/ 21/28
31.10.2024 15:59 ESP32 GPIO Tutorial Using ESP-IDF | LED Blinking Example

Advertise Here


Table of Contents

https://embetronicx.com/tutorials/wireless/esp32/idf/esp32-gpio-tutorial-using-esp-idf/ 22/28
31.10.2024 15:59 ESP32 GPIO Tutorial Using ESP-IDF | LED Blinking Example

Advertise Here


Table of Contents

Most Viewed Posts Since June 2022


IOCTL in Linux (I/O Control) – Linux Device Driver Tutorial Part 8 (415,720)

Linux Device Driver Tutorial – Part 1 | Introduction (307,189)

Diagnostics and Communication Management Function Group – UDS Protocol Tutorial Part 2
(242,316)

Fixed: Prolific PL2303TA USB to Serial Windows 11 Problem (239,748)

Sysfs in Linux Kernel – Linux Device Driver Tutorial Part 11 (198,137)

SPI Device Driver Tutorial – Linux Device Driver Tutorial Part 47 (145,697)

Device File Creation – Linux Device Driver Tutorial Part 5 (144,282)

UDS Protocol Introduction (Unified Diagnostic Services) – UDS Protocol Tutorial Part 1
(140,917)

https://embetronicx.com/tutorials/wireless/esp32/idf/esp32-gpio-tutorial-using-esp-idf/ 23/28
31.10.2024 15:59 ESP32 GPIO Tutorial Using ESP-IDF | LED Blinking Example

First Linux Device Driver – Linux Device Driver Tutorial Part 2 (140,097)

Simple STM32 Bootloader Implementation – Bootloader Tutorial Part 3 (132,797)

FreeRTOS Tutorials

RTOS Introduction - Part 1

RTOS Introduction - Part 2

FreeRTOS Porting on LPC2148

FreeRTOS - Task Creation

FreeRTOS - Task Creation with Parameters

FreeRTOS - Binary Semaphore

FreeRTOS - Binary Semaphore in ISR

FreeRTOS - Counting Semaphore

→FreeRTOS - Mutex Tutorial


Table of Contents

FreeRTOS - Queue Tutorial

FreeRTOS - LED & LCD Task

ESP32 (ESP-IDF) Tutorials

ESP32 Introduction & Initial Process Flow

ESP32-IDF Getting Started

ESP32 GPIO Tutorial – LED Blinking and Push Button Example

ESP32-IDF UART Tutorial

RTX RTOS Tutorials

LPC2148 - RTX RTOS Porting

Keil Setup for STM32 CMSIS RTOS

RTX RTOS – STM32 GPIO Tutorial (CMSIS V2)

NuttX RTOS Tutorials

https://embetronicx.com/tutorials/wireless/esp32/idf/esp32-gpio-tutorial-using-esp-idf/ 24/28
31.10.2024 15:59 ESP32 GPIO Tutorial Using ESP-IDF | LED Blinking Example

Setup NuttX RTOS with ESP32

Blink LED on ESP32 using NuttX RTOS

ESP32 LED Blinky Example using NuttX (own app and driver)

ESP32 GPIO Interrupt example

NuttX RTOS I2C Example (ESP32 – ADXL345)

ADXL345 Single and Double Tap Detection

NuttX RTOS SPI Tutorial using ESP32

STM32 Tutorials

STM32 Bare Metal Tutorials

Creating a New Project for STM32 - Bare metal Part 1

STM32 GPIO Tutorial - Bare metal Part 2



Table of Contents

STM32 Timer Tutorial Part 1 – Bare Metal Part 3

STM32 RTOS Tutorials

Getting started with STM32 RTOS

STM32 RTOS – GPIO Tutorial (CMSIS V2)

STM32 Arduino Tutorials

STM32 SPI using Arduino IDE Tutorial

SD Card Interfacing with STM32 using Arduino IDE

STM32 Other Tutorials

STM32 SD Card Interfacing – STM32 SPI

STM32 Ethernet Example – HTTP Server Part 1

STM32 Ethernet using CGI – HTTP Server Part 2

https://embetronicx.com/tutorials/wireless/esp32/idf/esp32-gpio-tutorial-using-esp-idf/ 25/28
31.10.2024 15:59 ESP32 GPIO Tutorial Using ESP-IDF | LED Blinking Example

STM32 DMA – Part 1 (Memory to Memory Transfer)

STM32 UART DMA – Part 2 (Peripheral to Memory Transfer)

STM32 USB Host MSC – Connect Pendrive to STM32

STM32 USB Device MSC using RAM – USB Device Tutorial Part 1

STM32 USB Device MSC using Internal Flash – USB Device Tutorial Part 2

Zephyr RTOS – STM32 Tutorials

Setup Zephyr RTOS for STM32 – Part 1

Zephyr RTOS – ESP32 Tutorials

Setup Zephyr RTOS for ESP32 – Part 1

RT-Thread RTOS Tutorials

RT-Thread RTOS Introduction


Getting Started STM32 with RT-Thread Tutorial – Part 1
Table of Contents

Thread Management using STM32 GPIO – RT-Thread Tutorial Part 2

RT-Thread Timer Explained using STM32 – RT-Thread Tutorial Part 3

Thread Synchronization (Semaphore) – RT-Thread Tutorial Part 4

Mutex and Event– RT-Thread Tutorial Part 5

Mailbox (Inter-thread communication) – RT-Thread Tutorial Part 6

Queue (Inter-thread Communication) – RT-Thread Tutorial Part 7

Signal (Inter-thread communication) – RT-Thread Tutorial Part 8

Automotive Tutorials

UDS Protocol Tutorials

UDS Protocol Introduction (Unified Diagnostic Services) – UDS Protocol Tutorial Part 1

Diagnostics and Communication Management – UDS Protocol Tutorial Part 2

https://embetronicx.com/tutorials/wireless/esp32/idf/esp32-gpio-tutorial-using-esp-idf/ 26/28
31.10.2024 15:59 ESP32 GPIO Tutorial Using ESP-IDF | LED Blinking Example

Data Transmission – UDS Protocol Tutorial Part 3

Input Output Control – UDS Protocol Tutorial Part 4

Routine Control Unit – UDS Protocol Tutorial Part 5

Upload Download Function Unit – UDS Protocol Tutorial Part 6

AUTOSAR Tutorials

AUTOSAR Introduction – AUTOSAR Tutorials Part 1

Application Layer in AUTOSAR – AUTOSAR Tutorials Part 2

Run Time Environment (RTE) Layer – AUTOSAR Tutorials Part 3

Reviews

Kaiweets KM601 Smart Digital Multimeter Review


HT208D Inrush Clamp Meter (6000 Counts) – Review
Table of Contents

Automatic Self Adjusting Wire Stripper (KAIWEETS KWS-103) – Review

KAIWEETS HT118A Multimeter – Review and How to Use?

https://embetronicx.com/tutorials/wireless/esp32/idf/esp32-gpio-tutorial-using-esp-idf/ 27/28
31.10.2024 15:59 ESP32 GPIO Tutorial Using ESP-IDF | LED Blinking Example


Table of Contents

TESA 77774 –
00002 –
00 çıkarılabilir…
4.1 194

170 80 TL

Contact Us | Advertise with Us | Disclaimer | FAQ | Trademark | Privacy Policy | Guest Post

Copyright EmbeTronicX 2024 © All Rights Reserved.

https://embetronicx.com/tutorials/wireless/esp32/idf/esp32-gpio-tutorial-using-esp-idf/ 28/28

You might also like