Setup the ESP-IDF environment

cd ~/development/SDKs/esp/esp-idf

. ./export.sh

Create my project

mkdir -p ~/development/espressif/

cd ~/development/espressif

idf.py create-project hello_world

cd hello_world




Write my program

#include <stdio.h>

 

#include “freertos/FreeRTOS.h”

#include “freertos/task.h”

 

void app_main(void)

{

    while (1)

    {

        printf(“Hello World!\n”);

        vTaskDelay(1000 / portTICK_PERIOD_MS);

    }

}

Building and flashing my program

idf.py set-target esp32

idf.py build

idf.py -p /dev/ttyUSB0 flash

View my program's output

idf.py -p /dev/ttyUSB0 monitor

Leave a Reply

Your email address will not be published. Required fields are marked *