0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

esp-idf の使い方 (create-project)

Last updated at Posted at 2025-02-14

こちらでは、サンプルのプロジェクトをコピーしましたが、新規のプロジェクトを作成する方法です。
esp-idf の使い方

プロジェクトの作成

idf.py create-project hello01

作成されたフォルダー構造

$ tree hello01
hello01
├── CMakeLists.txt
└── main
    ├── CMakeLists.txt
    └── hello01.c

プログラムの修正

main/hello01.c
#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"

void app_main(void)
{
	int count = 0;
    printf("Hello world!\n");
    printf("Good Morning!\n");
    printf("Good Afternoon!\n");
    printf("こんにちは\n");

while (1) {
    printf("Hello world! %d\n" , count);
	vTaskDelay(2000 / portTICK_PERIOD_MS);
	count ++;
	}
}

Build

idf.py set-target esp32
idf.py build
idf.py -p /dev/ttyUSB0 flash

実行結果

$ cu -l /dev/ttyUSB0 -s 115200
Connected.
Hello world! 190
Hello world! 191
Hello world! 192
Hello world! 193
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?