Skip to main content

ESP-IDF Basics - Assign. 1.2

··2 mins·
Table of Contents
Create a new project from the blink example and change the output GPIO pin via menuconfig
WS00A - This article is part of a series.
Part 3: This Article

Assignment outcomes
#

  1. A new project from the blink example is created.
  2. The output GPIO is changed according to the board schematic.
  3. The EVK LED is blinking.

Assignment steps outline
#

For this assignment, you will create a new project from the other get_started example: blink. In the blink example, you need to specify the GPIO on which the LED is connected. The default value is GPIO8 but it’s different on your board. You will need to change the configuration value through menuconfig.

  • Create the project from example as done in the previous assignment.
  • Change the example GPIO number in menuconfig:
    • Find the GPIO on which the LED is connected on your board
    • > ESP-IDF: SDK Configuration Editor (menuconfig)Example ConfigurationBlink GPIO number
  • Build, flash, and monitor the example.
  • Check that the LED is flashing. Is the output port correct? See the board schematic.
Fig.1 - Board Top View

Fig.1 - Board Top View

Bonus task
#

  • (Bonus) Change the main filename to hello_led_main.c and the project folder to hello_led. Did you encounter errors?
    • Where is the problem?
Solution

The linker is not informed that it needs to compile the file hello_led_main.c as well. You need to modify the CMakeLists.txt file, which contains the list of source files to include.

The build system is a topic covered in the advanced workshop.

idf_component_register(SRCS "hello_led_main.c"
                       INCLUDE_DIRS ".")

Conclusion
#

You have now a solid understanding of the project creation, building, and flashing. In the next lesson, we will focus on what usually is the main topic for an Espressif application – connectivity.

Next step
#

Next lecture → Lecture 2

Or go back to navigation menu

WS00A - This article is part of a series.
Part 3: This Article

Related