Get Started ESP32 by Examples 01 - Hello World
Welcome to AnalogLamb.Com Blog. Today we will begin to learn esp32 by examples. The first example is Hello world.
Target: We will print "Hello World" with ESP32 UART.
Step by Step to Learn the Example
1. We think that you have set up the building enviroment( Ubuntu + ESP-IDF). If you do not, Please to do it following Espressif tutorials.
2. We create a new folder for the example, named it "example01-helloworld". In Ubuntu, we use the comand as below:
mkdir example01-helloworld
3. And we create a sub-folder: main folder for the main.c file
cd example01-helloworld mkdir main
4. Then we use gedit to edit the main.c. It will create the main.c, and edit it.
gedit main.c
5. In the main.c file, we need to add some headers as below:
#include
#include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "esp_system.h" #include "esp_spi_flash.h"
Comments
Post a Comment