创建工程
- 文件结构:
1WS2812B
2├── CMakeLists.txt
3└── main
4 ├── CMakeLists.txt
5 └── main.c
CMakeLists.txt
1cmake_minimum_required(VERSION 3.16)
2
3include($ENV{IDF_PATH}/tools/cmake/project.cmake)
4project(WS2812B)
main/CMakeLists.txt
1idf_component_register(SRCS "main.c" INCLUDE_DIRS "")
main/main.c
1#include <stdio.h>
2#include "sdkconfig.h"
3
4void app_main(void)
5{
6 printf("Hello world!\n");
7 fflush(stdout);
8}
工程配置与烧写测试
1idf.py set-target esp32c3
2idf.py menuconfig
3idf.py build
4idf.py flash monitor